Title: [199274] trunk

Diff

Modified: trunk/LayoutTests/ChangeLog (199273 => 199274)


--- trunk/LayoutTests/ChangeLog	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/LayoutTests/ChangeLog	2016-04-09 20:13:12 UTC (rev 199274)
@@ -1,3 +1,16 @@
+2016-04-09  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r199268.
+        https://bugs.webkit.org/show_bug.cgi?id=156440
+
+        Broke Windows build (Requested by ap on #webkit).
+
+        Reverted changeset:
+
+        "Implement functional :host() pseudo class"
+        https://bugs.webkit.org/show_bug.cgi?id=156397
+        http://trac.webkit.org/changeset/199268
+
 2016-04-09  Michael Catanzaro  <[email protected]>
 
         [GTK] Update another GStreamer test expectation

Modified: trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html (199273 => 199274)


--- trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/LayoutTests/fast/shadow-dom/css-scoping-shadow-host-functional-rule.html	2016-04-09 20:13:12 UTC (rev 199274)
@@ -8,56 +8,41 @@
 </head>
 <body>
     <style>
-        host1, host2, host3, host4, host5 {
+        my-host, good-host, other-host, other-good-host {
             display: block;
             width: 100px;
-            height: 20px;
+            height: 50px;
             background: red;
         }
-        host3, host4, host5  {
+        good-host, other-good-host {
             background: green;
         }
     </style>
-    <p>Test passes if you see a single 100px by 100px green box below.</p>
-    <host1>
+    <p>Test passes if you see a single 100px by 100px green box below.</p> 
+    <my-host>
         <div>FAIL</div>
-    </host1>
-    <host2 id="bar" class="foo" name="baz">
-        <div>FAIL</div>
-    </host2>
-    <div>
-        <host3>
-            FAIL
-        </host3>
+    </my-host>
+    <div class="container">
+        <good-host>
+            <div>FAIL</div>
+        </good-host>
     </div>
-    <host4>
-        <div class="child">FAIL</div>
-    </host4>
-    <host5>
+    <other-host id="bar" class="foo" name="baz">
         <div>FAIL</div>
-    </host5>
+    </other-host>
+    <other-good-host>
+        <div class="child">FAIL</div>
+    </other-good-host>
     <script>
 
         try {
-            var shadowHost = document.querySelector('host1');
+            var shadowHost = document.querySelector('other-host');
             shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host1) { background: green !important; } </style>';
+            shadowRoot.innerHTML = '<style> :host(other-host.foo#bar[name=baz]) { background: green; } </style>';
 
-            shadowHost = document.querySelector('host2');
+            shadowHost = document.querySelector('other-good-host');
             shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host2.foo#bar[name=baz]) { background: green !important; } </style>';
-
-            shadowHost = document.querySelector('host3');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(div host3) { background: red !important; } </style>';
-
-            shadowHost = document.querySelector('host4');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(.child) { background: red !important; } </style>';
-
-            shadowHost = document.querySelector('host5');
-            shadowRoot = shadowHost.attachShadow({mode: 'open'});
-            shadowRoot.innerHTML = '<style> :host(host1) { background: red !important; } </style>';
+            shadowRoot.innerHTML = '<style> :host(.child) { background: red; } </style>';
         } catch (exception) {
             document.body.appendChild(document.createTextNode(exception));
         }

Modified: trunk/LayoutTests/platform/mac/TestExpectations (199273 => 199274)


--- trunk/LayoutTests/platform/mac/TestExpectations	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/LayoutTests/platform/mac/TestExpectations	2016-04-09 20:13:12 UTC (rev 199274)
@@ -1224,6 +1224,7 @@
 webkit.org/b/149128 fast/text/control-characters [ ImageOnlyFailure ]
 
 webkit.org/b/148695 fast/shadow-dom [ Pass ]
+webkit.org/b/149440 fast/shadow-dom/css-scoping-shadow-host-functional-rule.html [ ImageOnlyFailure ]
 
 # Touch events is not enabled on Mac
 webkit.org/b/149592 fast/shadow-dom/touch-event-ios.html [ Failure ]

Modified: trunk/Source/WebCore/ChangeLog (199273 => 199274)


--- trunk/Source/WebCore/ChangeLog	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/ChangeLog	2016-04-09 20:13:12 UTC (rev 199274)
@@ -1,3 +1,16 @@
+2016-04-09  Commit Queue  <[email protected]>
+
+        Unreviewed, rolling out r199268.
+        https://bugs.webkit.org/show_bug.cgi?id=156440
+
+        Broke Windows build (Requested by ap on #webkit).
+
+        Reverted changeset:
+
+        "Implement functional :host() pseudo class"
+        https://bugs.webkit.org/show_bug.cgi?id=156397
+        http://trac.webkit.org/changeset/199268
+
 2016-04-09  Antti Koivisto  <[email protected]>
 
         Implement functional :host() pseudo class

Modified: trunk/Source/WebCore/css/CSSGrammar.y.in (199273 => 199274)


--- trunk/Source/WebCore/css/CSSGrammar.y.in	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/CSSGrammar.y.in	2016-04-09 20:13:12 UTC (rev 199274)
@@ -368,7 +368,6 @@
 #if ENABLE_SHADOW_DOM
 
 %token <string> SLOTTEDFUNCTION
-%token <string> HOSTFUNCTION
 
 #endif
 
@@ -1368,9 +1367,6 @@
     | ':' ':' SLOTTEDFUNCTION maybe_space compound_selector maybe_space ')' {
         $$ = CSSParserSelector::parsePseudoElementSlottedFunctionSelector($3, $5);
     }
-    | ':' HOSTFUNCTION maybe_space compound_selector maybe_space ')' {
-        $$ = CSSParserSelector::parsePseudoClassHostFunctionSelector($2, $4);
-    }
 #endif
     // use by :-webkit-any.
     // FIXME: should we support generic selectors here or just simple_selectors?

Modified: trunk/Source/WebCore/css/CSSParser.cpp (199273 => 199274)


--- trunk/Source/WebCore/css/CSSParser.cpp	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/CSSParser.cpp	2016-04-09 20:13:12 UTC (rev 199274)
@@ -11897,12 +11897,6 @@
             return true;
         }
 #endif
-#if ENABLE(SHADOW_DOM)
-        if (isEqualToCSSIdentifier(name, "host")) {
-            m_token = HOSTFUNCTION;
-            return true;
-        }
-#endif
         return false;
 
     case 7:

Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (199273 => 199274)


--- trunk/Source/WebCore/css/CSSParserValues.cpp	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp	2016-04-09 20:13:12 UTC (rev 199274)
@@ -255,30 +255,6 @@
     selector->adoptSelectorVector(*selectorVector);
     return selector.release();
 }
-
-CSSParserSelector* CSSParserSelector::parsePseudoClassHostFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector* parsedSelector)
-{
-    ASSERT_UNUSED(functionIdentifier, String(functionIdentifier) == "host(");
-
-    if (!parsedSelector)
-        return nullptr;
-
-    std::unique_ptr<CSSParserSelector> ownedParsedSelector(parsedSelector);
-
-    for (auto* component = parsedSelector; component; component = component->tagHistory()) {
-        if (component->matchesPseudoElement())
-            return nullptr;
-    }
-
-    auto selectorVector = std::make_unique<Vector<std::unique_ptr<CSSParserSelector>>>();
-    selectorVector->append(WTFMove(ownedParsedSelector));
-
-    auto selector = std::make_unique<CSSParserSelector>();
-    selector->m_selector->setMatch(CSSSelector::PseudoClass);
-    selector->m_selector->setPseudoClassType(CSSSelector::PseudoClassHost);
-    selector->adoptSelectorVector(*selectorVector);
-    return selector.release();
-}
 #endif
 
 CSSParserSelector* CSSParserSelector::parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString)

Modified: trunk/Source/WebCore/css/CSSParserValues.h (199273 => 199274)


--- trunk/Source/WebCore/css/CSSParserValues.h	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/CSSParserValues.h	2016-04-09 20:13:12 UTC (rev 199274)
@@ -206,7 +206,6 @@
     static CSSParserSelector* parsePseudoElementCueFunctionSelector(const CSSParserString& functionIdentifier, Vector<std::unique_ptr<CSSParserSelector>>*);
 #if ENABLE(SHADOW_DOM)
     static CSSParserSelector* parsePseudoElementSlottedFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector*);
-    static CSSParserSelector* parsePseudoClassHostFunctionSelector(const CSSParserString& functionIdentifier, CSSParserSelector*);
 #endif
     static CSSParserSelector* parsePseudoClassAndCompatibilityElementSelector(CSSParserString& pseudoTypeString);
 

Modified: trunk/Source/WebCore/css/ElementRuleCollector.cpp (199273 => 199274)


--- trunk/Source/WebCore/css/ElementRuleCollector.cpp	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/ElementRuleCollector.cpp	2016-04-09 20:13:12 UTC (rev 199274)
@@ -107,14 +107,9 @@
     return m_matchedRuleList;
 }
 
-inline void ElementRuleCollector::addMatchedRule(const RuleData& ruleData, unsigned specificity, StyleResolver::RuleRange& ruleRange)
+inline void ElementRuleCollector::addMatchedRule(const MatchedRule& matchedRule)
 {
-    // Update our first/last rule indices in the matched rules array.
-    ++ruleRange.lastRuleIndex;
-    if (ruleRange.firstRuleIndex == -1)
-        ruleRange.firstRuleIndex = ruleRange.lastRuleIndex;
-
-    m_matchedRules.append({ &ruleData, specificity });
+    m_matchedRules.append(matchedRule);
 }
 
 void ElementRuleCollector::clearMatchedRules()
@@ -237,19 +232,9 @@
     clearMatchedRules();
     m_result.ranges.lastAuthorRule = m_result.matchedProperties().size() - 1;
 
-    SelectorChecker::CheckingContext context(m_mode);
-    SelectorChecker selectorChecker(m_element.document());
-
     auto ruleRange = m_result.ranges.authorRuleRange();
-    for (auto& ruleData : shadowHostRules) {
-        if (ruleData.rule()->properties().isEmpty() && !includeEmptyRules)
-            continue;
-        auto& selector = *ruleData.selector();
-        unsigned specificity = 0;
-        if (!selectorChecker.matchHostPseudoClass(selector, m_element, context, specificity))
-            continue;
-        addMatchedRule(ruleData, specificity, ruleRange);
-    }
+    MatchRequest matchRequest(&shadowAuthorStyle, includeEmptyRules);
+    collectMatchingRulesForList(&shadowHostRules, matchRequest, ruleRange);
 
     // We just sort the host rules before other author rules. This matches the current vague spec language
     // but is not necessarily exactly what is needed.
@@ -501,8 +486,15 @@
             continue;
 
         unsigned specificity;
-        if (ruleMatches(ruleData, specificity))
-            addMatchedRule(ruleData, specificity, ruleRange);
+        if (ruleMatches(ruleData, specificity)) {
+            // Update our first/last rule indices in the matched rules array.
+            ++ruleRange.lastRuleIndex;
+            if (ruleRange.firstRuleIndex == -1)
+                ruleRange.firstRuleIndex = ruleRange.lastRuleIndex;
+
+            // Add this rule to our list of matched rules.
+            addMatchedRule({&ruleData, specificity});
+        }
     }
 }
 

Modified: trunk/Source/WebCore/css/ElementRuleCollector.h (199273 => 199274)


--- trunk/Source/WebCore/css/ElementRuleCollector.h	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/ElementRuleCollector.h	2016-04-09 20:13:12 UTC (rev 199274)
@@ -89,7 +89,7 @@
     void sortMatchedRules();
     void sortAndTransferMatchedRules();
 
-    void addMatchedRule(const RuleData&, unsigned specificity, StyleResolver::RuleRange&);
+    void addMatchedRule(const MatchedRule&);
 
     const Element& m_element;
     const RuleSet& m_authorStyle;

Modified: trunk/Source/WebCore/css/RuleSet.cpp (199273 => 199274)


--- trunk/Source/WebCore/css/RuleSet.cpp	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/RuleSet.cpp	2016-04-09 20:13:12 UTC (rev 199274)
@@ -70,6 +70,10 @@
     }
     if (SelectorChecker::isCommonPseudoClassSelector(&selector))
         return MatchBasedOnRuleHash::ClassB;
+#if ENABLE(SHADOW_DOM)
+    if (selector.match() == CSSSelector::PseudoClass && selector.pseudoClassType() == CSSSelector::PseudoClassHost)
+        return MatchBasedOnRuleHash::ClassB;
+#endif
     if (selector.match() == CSSSelector::Id)
         return MatchBasedOnRuleHash::ClassA;
     if (selector.match() == CSSSelector::Class)

Modified: trunk/Source/WebCore/css/SelectorChecker.cpp (199273 => 199274)


--- trunk/Source/WebCore/css/SelectorChecker.cpp	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/SelectorChecker.cpp	2016-04-09 20:13:12 UTC (rev 199274)
@@ -199,25 +199,6 @@
     return true;
 }
 
-
-bool SelectorChecker::matchHostPseudoClass(const CSSSelector& selector, const Element& element, CheckingContext& checkingContext, unsigned& specificity) const
-{
-    ASSERT(element.shadowRoot());
-    ASSERT(selector.match() == CSSSelector::PseudoClass && selector.pseudoClassType() == CSSSelector::PseudoClassHost);
-    ASSERT(checkingContext.resolvingMode != SelectorChecker::Mode::QueryingRules);
-    // :host doesn't combine with any other selectors.
-    if (selector.tagHistory())
-        return false;
-    specificity = selector.simpleSelectorSpecificity();
-    if (auto* selectorList = selector.selectorList()) {
-        LocalContext context(selector, element, VisitedMatchType::Enabled, NOPSEUDO);
-        unsigned ignoredSpecificity;
-        if (!matchSelectorList(checkingContext, context, element, *selectorList, ignoredSpecificity))
-            return false;
-    }
-    return true;
-}
-
 inline static bool hasScrollbarPseudoElement(const PseudoIdSet& dynamicPseudoIdSet)
 {
     PseudoIdSet scrollbarIdSet = { SCROLLBAR, SCROLLBAR_THUMB, SCROLLBAR_BUTTON, SCROLLBAR_TRACK, SCROLLBAR_TRACK_PIECE, SCROLLBAR_CORNER };

Modified: trunk/Source/WebCore/css/SelectorChecker.h (199273 => 199274)


--- trunk/Source/WebCore/css/SelectorChecker.h	2016-04-09 18:16:14 UTC (rev 199273)
+++ trunk/Source/WebCore/css/SelectorChecker.h	2016-04-09 20:13:12 UTC (rev 199274)
@@ -95,8 +95,6 @@
 
     bool match(const CSSSelector&, const Element&, CheckingContext&, unsigned& specificity) const;
 
-    bool matchHostPseudoClass(const CSSSelector&, const Element&, CheckingContext&, unsigned& specificity) const;
-
     static bool isCommonPseudoClassSelector(const CSSSelector*);
     static bool matchesFocusPseudoClass(const Element&);
     static bool attributeSelectorMatches(const Element&, const QualifiedName&, const AtomicString& attributeValue, const CSSSelector&);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to