This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22769 - insertRule() should parse generic qualified rules / at-rules further
Summary: insertRule() should parse generic qualified rules / at-rules further
Alias: None
Product: CSS
Classification: Unclassified
Component: CSSOM (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Simon Pieters
QA Contact: public-css-bugzilla
Depends on:
Reported: 2013-07-23 10:21 UTC by Simon Sapin
Modified: 2013-08-26 14:29 UTC (History)
1 user (show)

See Also:


Description Simon Sapin 2013-07-23 10:21:08 UTC
The CSSStyleSheet and CSSGroupingRule interfaces both have a insertRule() method that refers (indirectly) to the "Parse a rule" algorithm of CSS Syntax.
The result of "Parse a rule" (when it’s not a syntax error) is a generic qualified rule or at-rule whose prelude and block can contain anything.

These concepts of generic rules exist for separation of concerns so that Syntax does not have to know about Selectors, every CSS at-rule, etc. For example, a valid qualified rule can be an invalid style rule if its prelude is an invalid list of selectors.

Perhaps I’m splitting hairs, but I think that CSSOM is missing a step where the results from Syntax are parsed further into specific rules, as defined in their respective specification. This can return a syntax error even if Syntax’s "Parse a rule" did not, in which case insertRule() should throw.
Comment 1 Simon Pieters 2013-08-26 14:29:02 UTC