Don't treat pipe as descendant combinator
There is currently a bug where selectors such as 'div | .c' matches a .c-descendant of div. This is because of a bug in the parser, where the '|' is consumed as part of the failing branch of CSSSelectorParser:: ConsumeName. This CL changes the behavior to look ahead at the token after the pipe delimiter: if it's not an <ident> or '*', we consume nothing and leave the '|' unconsumed. This causes subsequent parsing attempts on the CSSParserTokenRange to fail. We had one test (non-WPT) that tried to use selectors such as tns|#testInsertRule, but this is actually not valid. (Sidenote: the test failed in Firefox). Added '*' to make it valid. Bug: 1052847 Change-Id: I51e6a67a5e44cf3c0fe9d9fc7abea3772d0f4d9b Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2058814Reviewed-by:Rune Lillesveen <futhark@chromium.org> Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Cr-Commit-Position: refs/heads/master@{#742115}
Showing
Please register or sign in to comment