DescriptionNo pseudo elements in SelectorChecker::Mode QueryingRules.
QueryingRules mode is used by the Selectors APIs and when selecting
distributed nodes from the select attribute of the <content> element in
Shadow DOM V0.
CSSSelector::isCompound called from HTMLContentElement::validateSelect
makes sure we don't pass selectors with pseudo element selectors to the
rule collector.
Here we introduce a check which skips adding a selector to the selector
list in SelectorDataList if it will match a pseudo element. Such
selectors are still valid, and won't throw, but will result in an empty
result. If no selectors are added to SelectorDataList, we just skip the
DOM traversal.
This means we can replace the QueryingRules check in checkPseudoElement
with an assert.
BUG=489481
Committed: https://crrev.com/58d20bd734ac3b61c4548fd3c9d451a9d458f3bc
Cr-Commit-Position: refs/heads/master@{#372342}
Patch Set 1 #Patch Set 2 : Rebased #Patch Set 3 : CORE_EXPORT for unit test in component build #
Total comments: 3
Patch Set 4 : Rebased #Patch Set 5 : Reverted ++index change and wrote regression test for it #Patch Set 6 : Rebase fix #
Total comments: 2
Patch Set 7 : Another review issue #Messages
Total messages: 31 (12 generated)
|