[css-properties-values-api] Syntax string parser.
This CL implements the syntax string parser according to the new spec. The parser operates on the "preprocessed input stream" described by css-syntax, and while it reuses some algorithms used by the tokenizer, it does not rely on actual tokens. Overview of this CL: * Added CSSSyntaxStringParser, which can parse the syntax string into a CSSSyntaxDescriptor. Usage: auto descriptor = CSSSyntaxStringParser("<color>").Parse(); * The previous syntax string parser functions were mixed together with functions for parsing a token stream against a registered syntax, which was a little confusing. Hence this CL splits the syntax string parsing into a separate class. * Moved a few parser algorithms from CSSTokenizer to css_parser_idioms, to make them usable without a tokenizer. * Unit tests: there is some overlap between the unit tests and WPT. However, the unit tests can (and do) check the resulting internal structure of the CSSSyntaxDescriptors, so they do add additional value over just WPT. R=futhark@chromium.org, ikilpatrick@chromium.org Change-Id: I2d671ca0e58cd123a7809a24a4e83aec3883b175 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1503755Reviewed-by:Ian Kilpatrick <ikilpatrick@chromium.org> Reviewed-by:
Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#638178}
Showing
This diff is collapsed.
Please register or sign in to comment