X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=src%2Fthird_party%2FWebKit%2FSource%2Fcore%2Fhtml%2FHTMLContentElement.cpp;h=62eaf750d667790e90d16170e265d0c7c0831ee7;hb=8be7648e3bc188a587d5050c5a945c1099957e8b;hp=c6495abf9e25bc8c1727f5393e979cd4a479eb62;hpb=3cb1527a1d0111fd75188ac2c34c117944473076;p=platform%2Fframework%2Fweb%2Fcrosswalk.git diff --git a/src/third_party/WebKit/Source/core/html/HTMLContentElement.cpp b/src/third_party/WebKit/Source/core/html/HTMLContentElement.cpp index c6495ab..62eaf75 100644 --- a/src/third_party/WebKit/Source/core/html/HTMLContentElement.cpp +++ b/src/third_party/WebKit/Source/core/html/HTMLContentElement.cpp @@ -28,6 +28,7 @@ #include "core/html/HTMLContentElement.h" #include "HTMLNames.h" +#include "RuntimeEnabledFeatures.h" #include "core/css/SelectorChecker.h" #include "core/css/SiblingTraversalStrategies.h" #include "core/css/parser/BisonCSSParser.h" @@ -92,11 +93,18 @@ bool HTMLContentElement::validateSelect() const if (!m_selectorList.isValid()) return false; + bool disallowPseudoClasses = !RuntimeEnabledFeatures::pseudoClassesInMatchingCriteriaInAuthorShadowTreesEnabled() && containingShadowRoot() && containingShadowRoot()->type() == ShadowRoot::AuthorShadowRoot; + for (const CSSSelector* selector = m_selectorList.first(); selector; selector = m_selectorList.next(*selector)) { if (!selector->isCompound()) return false; + if (!disallowPseudoClasses) + continue; + for (const CSSSelector* subSelector = selector; subSelector; subSelector = subSelector->tagHistory()) { + if (subSelector->m_match == CSSSelector::PseudoClass) + return false; + } } - return true; }