November 2011
Intermediate to advanced
320 pages
10h 18m
English
An undoubtedly HTML-inspired behavior that sets CSS apart from most other languages is that compliant parsers are expected to continue after encountering a syntax error and restart at the next matching curly bracket (some superficial nesting-level tracking is mandated by the spec). In particular, the following stylesheet snippet, despite being obviously malformed, will still apply the specified border style to all <img> tags:
a {
$$$ This syntax makes absolutely no sense $$$
!(@*#)!!@ 123
}
img {
border: 1px solid red;
}This unusual behavior creates an opportunity to exploit parser incompatibilities in an interesting way: If there is any way to derail a particular CSS implementation with inputs that seem valid to ...
Read now
Unlock full access