[CSSParser] Use streaming tokenizer for @supports rules and CSS.supports
This gets us one step closer to using the streaming tokenizer for declarations, which will allow us to preserve raw text for CSS variable values. The existing logic made heavy use of sub-ranges to track block boundaries and restart parsing to find the correct branch of a production. To support the new logic, the streaming tokenizer's BlockGuard gained the ability to tell its caller whether the end of the block it was created for has been reached. Since the streaming parser cannot be rewound to a previous position, the supports parser had to be restructured to peek ahead more than one token for the supports-in-parens grammar, and to decide based on lead token whether to parse supports-feature or general-enclosed. Finally, to maintain support for the CSSConditionRule.conditionText property, the streaming tokenizer gained the ability to return raw text for an underlying range. Bug: 661854 Change-Id: I7fcf244e5f360e3715c8543ac7283e351d6b2baf Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2238512Reviewed-by:Anders Hartvoll Ruud <andruud@chromium.org> Commit-Queue: Kevin Babbitt <kbabbitt@microsoft.com> Cr-Commit-Position: refs/heads/master@{#789195}
Showing
This diff is collapsed.
Please register or sign in to comment