[:is/:where] Enforce pseudo-element restriction in ConsumeSimpleSelector
When parsing a simple selector, we currently check after-the-fact whether we followed a pseudo-element, and whether or not the simple selector was allowed to follow that pseudo-element. If the simple selector was _not_ allowed to follow a pseudo-element, then parsing failed altogether. This does not work well for nested <forgiving-selector-list>s, which requires partial failure. For example, ::part(foo):is(.a,:hover) shall behave as ::part(foo):is(:hover) (instead of failing). This CL instead checks for simple selector validity in ConsumeSimpleSelector, by storing a "restricting pseudo element" during parsing of the compound containing the pseudo-element. This makes it possible for deeply nested selectors to fail at the appropriate time and trigger the forgiving behavior. Bug: 568705 Change-Id: Icfb20416c008e37279866a688a525b9419437086 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2450191 Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org> Reviewed-by:Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#815305}
Showing
Please register or sign in to comment