VasilyStepanov / libsacc

[WARNING: under construction! Feel free to join.] SAC implementation written in C
GNU Lesser General Public License v3.0
2 stars 0 forks source link

handle 'invalid block' in 'media query' #16

Open VasilyStepanov opened 12 years ago

VasilyStepanov commented 12 years ago

At-rules starts with an at-keyword and consists of everything up to and including the next semicolon or the next block, whichever comes first. (proof http://www.w3.org/TR/CSS21/syndata.html#at-rules)

The parser is to handle unexpected tokens encountered while parsing a media query by reading until the end of the media query, while observing the rules for matching pairs of (), [], {}, "", and '', and correctly handling escapes. (proof http://www.w3.org/TR/css3-mediaqueries/#error-handling)

So this

@media {example, all,}, speech { /* ... */ }

must be parsed as

@media { /* error while parsing rulesets */ }
/* error while parsing selectors */

or as

@media /* error while parsing media query */ speech { /* ... */ }
VasilyStepanov commented 12 years ago

According to this thread it must be parsed as

@media { /* error while parsing rulesets */ }
/* error while parsing selectors */