Open
Description
As a follow up on the second part of this comment, which was about replacing the steps parse a list of component values and match the result against the corresponding grammar, by parse something according to a CSS grammar, I create this (list of) issue(s) (and suggestions) about the parsing procedures used across Syntax, CSSOM, Selectors, Media Queries, etc.
- fixed in 10d1cea - CSS Syntax is missing
<style-block>
in the section title 8.1. Defining Block Contents: the<declaration-list>
,<rule-list>
, and<stylesheet>
productions. - fixed in 6ab5888 - CSS Syntax associates "style block" to parse a list of declarations instead of parse a
<style-block>
. - fixed in 7d4d5b0 - CSS Counter Styles - (set) CSSCounterStyleRule.
<descriptor>
should use parse something according to a CSS grammar using the descriptor’s grammar instead of parse a list of component values, otherwise the component values will not be parsed against the grammar of the corresponding descriptor (only the basic syntax will be validated). - CSS Syntax defines parse a list of component values as the entry point to parse a stand-alone selector, but parse a selector should be used.
- CSS Syntax defines parse a list of component values as the entry point to parse
Element.media
, but parse a media query list should be used. - CSS Conditional defines that a CSS processor is considered to support a declaration (consisting of a property and value) if it accepts that declaration: it would be helpfull to refer to parse something according to a CSS grammar using the grammar of the property, or to parse a CSS value.
- CSSOM defines parse a CSS value for parsing a property declaration value: parse a CSS property value seems a more correct name because the procedure receives a
property
and what is a CSS value is not defined anywhere: at least, it can also be a CSS descriptor value. - CSSOM defines parse a CSS value with parse a list of component values composed with match [the result] against the grammar for the property
property
in the CSS specification but it could refer to parse something according to a CSS grammar using the property’s grammar instead. - fixed in [cssom-1] Avoid validating declarations twice #9831 - CSSOM defines parse a CSS declaration block with let parsed declaration be the result of parsing declaration according to the appropriate CSS specifications, dropping parts that are said to be ignored, but this step could be replaced by parse something according to a CSS grammar with the property’s grammar, or by parse a CSS value with the property and its value.
- invalid: it can also be used for other rules than style rules - Parse a CSS declaration block could be named parse a CSS style block contents because a "block" implies the presence of its associated tokens whereas this procedure only takes the contents of the block, which also accepts (but ignores) nested rules.
- CSS Page defines that
@page
rules are parsed with parse something according to a CSS grammar but this algorithm does not expect a high level rule object resulting from consuming stylesheet's contents - fixed in 6ab5888 - CSS Cascade defines fetch an
@import
(removed in Cascade 5) with a step that includes parse a stylesheetbut it would be helpfull to note that only the basic syntax will be validated, or to define that parse a CSS style sheet should be used, otherwise the list of rules will not be parsed against the context rules or the corresponding grammar for the rule (only the basic syntax will be validated and the nested rule's contents will be left unparsed as a list of component values). - CSS Syntax does not define where/when parse a CSS stylesheet should run (dedicated issue: #2997) and its return value.
- invalid: see [mediaqueries-5] Parsing
<media-query-list>
when the input is<whitespace-token>
#9173 - CSS Media Queries defines the procedure to parse<media-query-list>
with parse a comma-separated list of component values composed with parse something according to a CSS grammar using<media-query>
, but it should use parse a comma-separated list according to a CSS grammar using<media-query>
instead, therefore parsing a whitespace as input (eg. fromElement.media
) to an empty list instead ofnot all
(as defined in parse a media query or a media query list), and it should define this production specific rule: an empty list should default toall
and an invalid<media-query>
should default tonot all
.