Open Bug 880151 Opened 11 years ago Updated 2 years ago

CSS tokenizer should produce implied tokens at EOF to close open constructs

Categories

(Core :: CSS Parsing and Computation, defect)

defect

Tracking

()

People

(Reporter: heycam, Unassigned)

Details

Resolution from CSS WG F2F: http://www.w3.org/2013/06/05-css-irc#T08-23-20 This means nsCSSScanner should produce any necessary closing ")", "]", "}" tokens at EOF.
Should the tokenizer/scanner actually emit these tokens, or just pretend that it did for the purpose of serialization? Note that actually emitting requires maintaining a stack of what’s open.
I thought from the discussion that the tokens would actually be emitted. Currently what is open and needs balancing is not tracked in a separate stack, but in the structure of the parsing functions in nsCSSParser. So I guess we could handle it at each spot where we encounter an EOF token in the parser.
Do we actually keep tokens around, aside from special cases like Variables/Custom Properties? I think this only requires implementation changes in such cases.
No, we don't. Currently we store CSSConditionRule.conditionText as a string, and not a token list. We'll need to append the characters corresponding to these implied tokens (regardless of whether nsCSSScanner actually emits them) on to that string at some point.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.