| Index: Source/core/html/HTMLContentElement.cpp
|
| diff --git a/Source/core/html/HTMLContentElement.cpp b/Source/core/html/HTMLContentElement.cpp
|
| index 5f56d5d13b1ef5c6500d1105a94d5791789e9ada..cc6a1aefcc89770d11157868a5627c7d2f17eaf8 100644
|
| --- a/Source/core/html/HTMLContentElement.cpp
|
| +++ b/Source/core/html/HTMLContentElement.cpp
|
| @@ -83,6 +83,11 @@ void HTMLContentElement::parseAttribute(const QualifiedName& name, const AtomicS
|
| }
|
| }
|
|
|
| +static inline bool includesDisallowedPseudoClass(const CSSSelector& selector)
|
| +{
|
| + return selector.m_match == CSSSelector::PseudoClass && selector.m_pseudoType != CSSSelector::PseudoNot;
|
| +}
|
| +
|
| bool HTMLContentElement::validateSelect() const
|
| {
|
| ASSERT(!m_shouldParseSelect);
|
| @@ -93,15 +98,15 @@ bool HTMLContentElement::validateSelect() const
|
| if (!m_selectorList.isValid())
|
| return false;
|
|
|
| - bool disallowPseudoClasses = !RuntimeEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled() && containingShadowRoot() && containingShadowRoot()->type() == ShadowRoot::AuthorShadowRoot;
|
| + bool allowAnyPseudoClasses = RuntimeEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled() || (containingShadowRoot() && containingShadowRoot()->type() == ShadowRoot::UserAgentShadowRoot);
|
|
|
| for (const CSSSelector* selector = m_selectorList.first(); selector; selector = m_selectorList.next(*selector)) {
|
| if (!selector->isCompound())
|
| return false;
|
| - if (!disallowPseudoClasses)
|
| + if (allowAnyPseudoClasses)
|
| continue;
|
| for (const CSSSelector* subSelector = selector; subSelector; subSelector = subSelector->tagHistory()) {
|
| - if (subSelector->m_match == CSSSelector::PseudoClass)
|
| + if (includesDisallowedPseudoClass(*subSelector))
|
| return false;
|
| }
|
| }
|
|
|