VasilyStepanov/libsacc — Issue #16: Handle 'invalid block' in 'media query'
Author: VasilyStepanov
Created: 2012-01-29 18:44:08+00:00
State: open

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)

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

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

must be parsed as

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

or as

```css
@media /* error while parsing media query */ speech { /* ... */ }
```