Title: [209671] trunk/Source/WebCore
Revision
209671
Author
[email protected]
Date
2016-12-10 12:38:50 -0800 (Sat, 10 Dec 2016)

Log Message

[CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
https://bugs.webkit.org/show_bug.cgi?id=165730

Reviewed by Simon Fraser.

* WebCore.xcodeproj/project.pbxproj:
* css/CSSCustomPropertyValue.cpp:
* css/CSSPrimitiveValue.cpp:
* css/CSSSelectorList.cpp:
* css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
* css/parser/CSSParserImpl.cpp:
* css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
* css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
* css/parser/CSSParserValues.cpp: Removed.
* css/parser/CSSParserValues.h: Removed.
* css/parser/CSSSelectorParser.h:

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebCore/CMakeLists.txt (209670 => 209671)


--- trunk/Source/WebCore/CMakeLists.txt	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/CMakeLists.txt	2016-12-10 20:38:50 UTC (rev 209671)
@@ -1380,7 +1380,7 @@
     css/parser/CSSParserObserverWrapper.cpp
     css/parser/CSSParserToken.cpp
     css/parser/CSSParserTokenRange.cpp
-    css/parser/CSSParserValues.cpp
+    css/parser/CSSParserSelector.cpp
     css/parser/CSSPropertyParser.cpp
     css/parser/CSSPropertyParserHelpers.cpp
     css/parser/CSSSelectorParser.cpp

Modified: trunk/Source/WebCore/ChangeLog (209670 => 209671)


--- trunk/Source/WebCore/ChangeLog	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/ChangeLog	2016-12-10 20:38:50 UTC (rev 209671)
@@ -1,5 +1,24 @@
 2016-12-10  Dave Hyatt  <[email protected]>
 
+        [CSS Parser] Move CSSParserValues.h/.cpp to CSSParserSelector.h/.cpp
+        https://bugs.webkit.org/show_bug.cgi?id=165730
+
+        Reviewed by Simon Fraser.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSCustomPropertyValue.cpp:
+        * css/CSSPrimitiveValue.cpp:
+        * css/CSSSelectorList.cpp:
+        * css/makeSelectorPseudoClassAndCompatibilityElementMap.py:
+        * css/parser/CSSParserImpl.cpp:
+        * css/parser/CSSParserSelector.cpp: Copied from Source/WebCore/css/parser/CSSParserValues.cpp.
+        * css/parser/CSSParserSelector.h: Copied from Source/WebCore/css/parser/CSSParserValues.h.
+        * css/parser/CSSParserValues.cpp: Removed.
+        * css/parser/CSSParserValues.h: Removed.
+        * css/parser/CSSSelectorParser.h:
+
+2016-12-10  Dave Hyatt  <[email protected]>
+
         [CSS Parser] Remove the pseudoclass/element hacks
         https://bugs.webkit.org/show_bug.cgi?id=165729
 

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (209670 => 209671)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-12-10 20:38:50 UTC (rev 209671)
@@ -3518,8 +3518,8 @@
 		946D372D1D6CB2940077084F /* CSSParser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37281D6CB28B0077084F /* CSSParser.cpp */; };
 		946D372E1D6CB2940077084F /* CSSParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37291D6CB28B0077084F /* CSSParser.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		946D372F1D6CB2940077084F /* CSSParserMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372A1D6CB28B0077084F /* CSSParserMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
-		946D37301D6CB2940077084F /* CSSParserValues.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D372B1D6CB28B0077084F /* CSSParserValues.cpp */; };
-		946D37311D6CB2940077084F /* CSSParserValues.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372C1D6CB28B0077084F /* CSSParserValues.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		946D37301D6CB2940077084F /* CSSParserSelector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D372B1D6CB28B0077084F /* CSSParserSelector.cpp */; };
+		946D37311D6CB2940077084F /* CSSParserSelector.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D372C1D6CB28B0077084F /* CSSParserSelector.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		946D37391D6CDFC00077084F /* CSSTokenizer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37341D6CDF980077084F /* CSSTokenizer.cpp */; };
 		946D373A1D6CDFC00077084F /* CSSTokenizer.h in Headers */ = {isa = PBXBuildFile; fileRef = 946D37371D6CDF980077084F /* CSSTokenizer.h */; };
 		946D373B1D6CDFC00077084F /* CSSTokenizerInputStream.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 946D37351D6CDF980077084F /* CSSTokenizerInputStream.cpp */; };
@@ -11094,8 +11094,8 @@
 		946D37281D6CB28B0077084F /* CSSParser.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParser.cpp; path = parser/CSSParser.cpp; sourceTree = "<group>"; };
 		946D37291D6CB28B0077084F /* CSSParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParser.h; path = parser/CSSParser.h; sourceTree = "<group>"; };
 		946D372A1D6CB28B0077084F /* CSSParserMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserMode.h; path = parser/CSSParserMode.h; sourceTree = "<group>"; };
-		946D372B1D6CB28B0077084F /* CSSParserValues.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserValues.cpp; path = parser/CSSParserValues.cpp; sourceTree = "<group>"; };
-		946D372C1D6CB28B0077084F /* CSSParserValues.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserValues.h; path = parser/CSSParserValues.h; sourceTree = "<group>"; };
+		946D372B1D6CB28B0077084F /* CSSParserSelector.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSParserSelector.cpp; path = parser/CSSParserSelector.cpp; sourceTree = "<group>"; };
+		946D372C1D6CB28B0077084F /* CSSParserSelector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSParserSelector.h; path = parser/CSSParserSelector.h; sourceTree = "<group>"; };
 		946D37341D6CDF980077084F /* CSSTokenizer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSTokenizer.cpp; path = parser/CSSTokenizer.cpp; sourceTree = "<group>"; };
 		946D37351D6CDF980077084F /* CSSTokenizerInputStream.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = CSSTokenizerInputStream.cpp; path = parser/CSSTokenizerInputStream.cpp; sourceTree = "<group>"; };
 		946D37371D6CDF980077084F /* CSSTokenizer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CSSTokenizer.h; path = parser/CSSTokenizer.h; sourceTree = "<group>"; };
@@ -19073,8 +19073,8 @@
 				946D373D1D6CE31A0077084F /* CSSParserToken.h */,
 				946D374B1D6D07F50077084F /* CSSParserTokenRange.cpp */,
 				946D374C1D6D07F50077084F /* CSSParserTokenRange.h */,
-				946D372B1D6CB28B0077084F /* CSSParserValues.cpp */,
-				946D372C1D6CB28B0077084F /* CSSParserValues.h */,
+				946D372B1D6CB28B0077084F /* CSSParserSelector.cpp */,
+				946D372C1D6CB28B0077084F /* CSSParserSelector.h */,
 				946D37411D6CF6320077084F /* CSSPropertyParser.cpp */,
 				946D37421D6CF6320077084F /* CSSPropertyParser.h */,
 				949C77021D6E393500C0DE4F /* CSSPropertyParserHelpers.cpp */,
@@ -25250,7 +25250,7 @@
 				949C77091D6E498700C0DE4F /* CSSParserObserverWrapper.h in Headers */,
 				946D37401D6CE3C20077084F /* CSSParserToken.h in Headers */,
 				946D374E1D6D08AA0077084F /* CSSParserTokenRange.h in Headers */,
-				946D37311D6CB2940077084F /* CSSParserValues.h in Headers */,
+				946D37311D6CB2940077084F /* CSSParserSelector.h in Headers */,
 				9418278F1D8CAF9200492764 /* CSSPendingSubstitutionValue.h in Headers */,
 				977B3863122883E900B81FF8 /* CSSPreloadScanner.h in Headers */,
 				A80E6CE60A1989CA007FB8C5 /* CSSPrimitiveValue.h in Headers */,
@@ -29063,7 +29063,7 @@
 				949C77081D6E498700C0DE4F /* CSSParserObserverWrapper.cpp in Sources */,
 				946D373F1D6CE3C20077084F /* CSSParserToken.cpp in Sources */,
 				946D374D1D6D08A60077084F /* CSSParserTokenRange.cpp in Sources */,
-				946D37301D6CB2940077084F /* CSSParserValues.cpp in Sources */,
+				946D37301D6CB2940077084F /* CSSParserSelector.cpp in Sources */,
 				9418278E1D8CAF9200492764 /* CSSPendingSubstitutionValue.cpp in Sources */,
 				977B3862122883E900B81FF8 /* CSSPreloadScanner.cpp in Sources */,
 				A80E6D050A1989CA007FB8C5 /* CSSPrimitiveValue.cpp in Sources */,

Modified: trunk/Source/WebCore/css/CSSAllInOne.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/CSSAllInOne.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/CSSAllInOne.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -67,7 +67,7 @@
 #include "CSSNamedImageValue.cpp"
 #include "CSSPageRule.cpp"
 #include "CSSParser.cpp"
-#include "CSSParserValues.cpp"
+#include "CSSParserSelector.cpp"
 #include "CSSProperty.cpp"
 #include "CSSPropertySourceData.cpp"
 #include "CSSReflectValue.cpp"

Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -26,7 +26,7 @@
 #include "config.h"
 #include "CSSCustomPropertyValue.h"
 
-#include "CSSParserValues.h"
+#include "CSSParserSelector.h"
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -26,7 +26,7 @@
 #include "CSSFontFamily.h"
 #include "CSSHelper.h"
 #include "CSSMarkup.h"
-#include "CSSParserValues.h"
+#include "CSSParserSelector.h"
 #include "CSSPrimitiveValueMappings.h"
 #include "CSSPropertyNames.h"
 #include "CSSToLengthConversionData.h"

Modified: trunk/Source/WebCore/css/CSSSelectorList.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/CSSSelectorList.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/CSSSelectorList.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -27,7 +27,7 @@
 #include "config.h"
 #include "CSSSelectorList.h"
 
-#include "CSSParserValues.h"
+#include "CSSParserSelector.h"
 #include <wtf/text/StringBuilder.h>
 
 namespace WebCore {

Modified: trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py (209670 => 209671)


--- trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/makeSelectorPseudoClassAndCompatibilityElementMap.py	2016-12-10 20:38:50 UTC (rev 209671)
@@ -91,7 +91,7 @@
 #include "config.h"
 #include "SelectorPseudoTypeMap.h"
 
-#include "CSSParserValues.h"
+#include "CSSParserSelector.h"
 
 #if defined(__clang__)
 #pragma clang diagnostic push

Modified: trunk/Source/WebCore/css/parser/CSSParserImpl.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/parser/CSSParserImpl.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -36,7 +36,7 @@
 #include "CSSKeyframesRule.h"
 #include "CSSParserObserver.h"
 #include "CSSParserObserverWrapper.h"
-#include "CSSParserValues.h" // FIXME-NEWPARSER We need to move CSSParserSelector to its own file.
+#include "CSSParserSelector.h"
 #include "CSSPropertyParser.h"
 #include "CSSSelectorParser.h"
 #include "CSSStyleSheet.h"

Copied: trunk/Source/WebCore/css/parser/CSSParserSelector.cpp (from rev 209670, trunk/Source/WebCore/css/parser/CSSParserValues.cpp) (0 => 209671)


--- trunk/Source/WebCore/css/parser/CSSParserSelector.cpp	                        (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSParserSelector.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -0,0 +1,245 @@
+/*
+ * Copyright (C) 2003 Lars Knoll ([email protected])
+ * Copyright (C) 2004, 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "CSSParserSelector.h"
+
+#include "CSSCustomPropertyValue.h"
+#include "CSSParserIdioms.h"
+#include "CSSPrimitiveValue.h"
+#include "CSSFunctionValue.h"
+#include "CSSSelector.h"
+#include "CSSSelectorList.h"
+#include "SelectorPseudoTypeMap.h"
+
+#if COMPILER(MSVC)
+// See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
+#pragma warning(disable: 4701)
+#endif
+
+namespace WebCore {
+
+using namespace WTF;
+
+CSSParserSelector* CSSParserSelector::parsePagePseudoSelector(const AtomicString& pseudoTypeString)
+{
+    CSSSelector::PagePseudoClassType pseudoType;
+    if (equalLettersIgnoringASCIICase(pseudoTypeString, "first"))
+        pseudoType = CSSSelector::PagePseudoClassFirst;
+    else if (equalLettersIgnoringASCIICase(pseudoTypeString, "left"))
+        pseudoType = CSSSelector::PagePseudoClassLeft;
+    else if (equalLettersIgnoringASCIICase(pseudoTypeString, "right"))
+        pseudoType = CSSSelector::PagePseudoClassRight;
+    else
+        return nullptr;
+    
+    auto selector = std::make_unique<CSSParserSelector>();
+    selector->m_selector->setMatch(CSSSelector::PagePseudoClass);
+    selector->m_selector->setPagePseudoType(pseudoType);
+    return selector.release();
+}
+
+CSSParserSelector* CSSParserSelector::parsePseudoElementSelectorFromStringView(StringView& pseudoTypeString)
+{
+    AtomicString name = pseudoTypeString.toAtomicString();
+    
+    CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(name);
+    if (pseudoType == CSSSelector::PseudoElementUnknown) {
+        // FIXME-NEWPARSER: We can't add "slotted" to the map without breaking the old
+        // parser, so this hack ensures the new parser still recognizes it. When the new
+        // parser turns on, we can add "slotted" to the map and remove this code.
+        if (pseudoTypeString.startsWithIgnoringASCIICase("slotted"))
+            pseudoType = CSSSelector::PseudoElementSlotted;
+        else
+            return nullptr;
+    }
+
+    auto selector = std::make_unique<CSSParserSelector>();
+    selector->m_selector->setMatch(CSSSelector::PseudoElement);
+    selector->m_selector->setPseudoElementType(pseudoType);
+    if (pseudoType == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed) {
+        ASSERT_WITH_MESSAGE(name == "-webkit-input-placeholder", "-webkit-input-placeholder is the only LegacyPrefix pseudo type.");
+        if (name == "-webkit-input-placeholder")
+            name = AtomicString("placeholder", AtomicString::ConstructFromLiteral);
+    }
+    selector->m_selector->setValue(name);
+    return selector.release();
+}
+
+CSSParserSelector* CSSParserSelector::parsePseudoClassSelectorFromStringView(StringView& pseudoTypeString)
+{
+    PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString);
+    if (pseudoType.pseudoClass != CSSSelector::PseudoClassUnknown) {
+        auto selector = std::make_unique<CSSParserSelector>();
+        selector->m_selector->setMatch(CSSSelector::PseudoClass);
+        selector->m_selector->setPseudoClassType(pseudoType.pseudoClass);
+        return selector.release();
+    }
+    if (pseudoType.compatibilityPseudoElement != CSSSelector::PseudoElementUnknown) {
+        auto selector = std::make_unique<CSSParserSelector>();
+        selector->m_selector->setMatch(CSSSelector::PseudoElement);
+        selector->m_selector->setPseudoElementType(pseudoType.compatibilityPseudoElement);
+        AtomicString name = pseudoTypeString.toAtomicString();
+        selector->m_selector->setValue(name);
+        return selector.release();
+    }
+    return nullptr;
+}
+
+CSSParserSelector::CSSParserSelector()
+    : m_selector(std::make_unique<CSSSelector>())
+{
+}
+
+CSSParserSelector::CSSParserSelector(const QualifiedName& tagQName)
+    : m_selector(std::make_unique<CSSSelector>(tagQName))
+{
+}
+
+CSSParserSelector::~CSSParserSelector()
+{
+    if (!m_tagHistory)
+        return;
+    Vector<std::unique_ptr<CSSParserSelector>, 16> toDelete;
+    std::unique_ptr<CSSParserSelector> selector = WTFMove(m_tagHistory);
+    while (true) {
+        std::unique_ptr<CSSParserSelector> next = WTFMove(selector->m_tagHistory);
+        toDelete.append(WTFMove(selector));
+        if (!next)
+            break;
+        selector = WTFMove(next);
+    }
+}
+
+void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
+{
+    auto selectorList = std::make_unique<CSSSelectorList>();
+    selectorList->adoptSelectorVector(selectorVector);
+    m_selector->setSelectorList(WTFMove(selectorList));
+}
+
+void CSSParserSelector::setLangArgumentList(std::unique_ptr<Vector<AtomicString>> argumentList)
+{
+    ASSERT_WITH_MESSAGE(!argumentList->isEmpty(), "No CSS Selector takes an empty argument list.");
+    m_selector->setLangArgumentList(WTFMove(argumentList));
+}
+
+void CSSParserSelector::setSelectorList(std::unique_ptr<CSSSelectorList> selectorList)
+{
+    m_selector->setSelectorList(WTFMove(selectorList));
+}
+
+static bool selectorListMatchesPseudoElement(const CSSSelectorList* selectorList)
+{
+    if (!selectorList)
+        return false;
+
+    for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
+        for (const CSSSelector* selector = subSelector; selector; selector = selector->tagHistory()) {
+            if (selector->matchesPseudoElement())
+                return true;
+            if (const CSSSelectorList* subselectorList = selector->selectorList()) {
+                if (selectorListMatchesPseudoElement(subselectorList))
+                    return true;
+            }
+        }
+    }
+    return false;
+}
+
+bool CSSParserSelector::matchesPseudoElement() const
+{
+    return m_selector->matchesPseudoElement() || selectorListMatchesPseudoElement(m_selector->selectorList());
+}
+
+void CSSParserSelector::insertTagHistory(CSSSelector::RelationType before, std::unique_ptr<CSSParserSelector> selector, CSSSelector::RelationType after)
+{
+    if (m_tagHistory)
+        selector->setTagHistory(WTFMove(m_tagHistory));
+    setRelation(before);
+    selector->setRelation(after);
+    m_tagHistory = WTFMove(selector);
+}
+
+void CSSParserSelector::appendTagHistory(CSSSelector::RelationType relation, std::unique_ptr<CSSParserSelector> selector)
+{
+    CSSParserSelector* end = this;
+    while (end->tagHistory())
+        end = end->tagHistory();
+
+    end->setRelation(relation);
+    end->setTagHistory(WTFMove(selector));
+}
+
+void CSSParserSelector::appendTagHistory(CSSParserSelectorCombinator relation, std::unique_ptr<CSSParserSelector> selector)
+{
+    CSSParserSelector* end = this;
+    while (end->tagHistory())
+        end = end->tagHistory();
+
+    CSSSelector::RelationType selectorRelation;
+    switch (relation) {
+    case CSSParserSelectorCombinator::Child:
+        selectorRelation = CSSSelector::Child;
+        break;
+    case CSSParserSelectorCombinator::DescendantSpace:
+        selectorRelation = CSSSelector::DescendantSpace;
+        break;
+#if ENABLE(CSS_SELECTORS_LEVEL4)
+    case CSSParserSelectorCombinator::DescendantDoubleChild:
+        selectorRelation = CSSSelector::DescendantDoubleChild;
+        break;
+#endif
+    case CSSParserSelectorCombinator::DirectAdjacent:
+        selectorRelation = CSSSelector::DirectAdjacent;
+        break;
+    case CSSParserSelectorCombinator::IndirectAdjacent:
+        selectorRelation = CSSSelector::IndirectAdjacent;
+        break;
+    }
+    end->setRelation(selectorRelation);
+    end->setTagHistory(WTFMove(selector));
+}
+
+void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool tagIsForNamespaceRule)
+{
+    auto second = std::make_unique<CSSParserSelector>();
+    second->m_selector = WTFMove(m_selector);
+    second->m_tagHistory = WTFMove(m_tagHistory);
+    m_tagHistory = WTFMove(second);
+
+    m_selector = std::make_unique<CSSSelector>(tagQName, tagIsForNamespaceRule);
+    m_selector->setRelation(CSSSelector::Subselector);
+}
+
+std::unique_ptr<CSSParserSelector> CSSParserSelector::releaseTagHistory()
+{
+    setRelation(CSSSelector::Subselector);
+    return WTFMove(m_tagHistory);
+}
+
+// FIXME-NEWPARSER: Add support for :host-context
+bool CSSParserSelector::isHostPseudoSelector() const
+{
+    return match() == CSSSelector::PseudoClass && pseudoClassType() == CSSSelector::PseudoClassHost;
+}
+
+}
+

Copied: trunk/Source/WebCore/css/parser/CSSParserSelector.h (from rev 209670, trunk/Source/WebCore/css/parser/CSSParserValues.h) (0 => 209671)


--- trunk/Source/WebCore/css/parser/CSSParserSelector.h	                        (rev 0)
+++ trunk/Source/WebCore/css/parser/CSSParserSelector.h	2016-12-10 20:38:50 UTC (rev 209671)
@@ -0,0 +1,135 @@
+/*
+ * Copyright (C) 2003 Lars Knoll ([email protected])
+ * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#pragma once
+
+#include "CSSSelector.h"
+#include "CSSValueKeywords.h"
+#include "CSSValueList.h"
+#include <wtf/text/AtomicString.h>
+#include <wtf/text/AtomicStringHash.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+
+class CSSValue;
+class QualifiedName;
+
+enum class CSSParserSelectorCombinator {
+    Child,
+    DescendantSpace,
+#if ENABLE(CSS_SELECTORS_LEVEL4)
+    DescendantDoubleChild,
+#endif
+    DirectAdjacent,
+    IndirectAdjacent
+};
+
+class CSSParserSelector {
+    WTF_MAKE_FAST_ALLOCATED;
+public:
+    static CSSParserSelector* parsePseudoClassSelectorFromStringView(StringView&);
+    static CSSParserSelector* parsePseudoElementSelectorFromStringView(StringView&);
+    static CSSParserSelector* parsePagePseudoSelector(const AtomicString&);
+    
+    CSSParserSelector();
+    explicit CSSParserSelector(const QualifiedName&);
+    ~CSSParserSelector();
+
+    std::unique_ptr<CSSSelector> releaseSelector() { return WTFMove(m_selector); }
+
+    void setValue(const AtomicString& value, bool matchLowerCase = false) { m_selector->setValue(value, matchLowerCase); }
+    
+    // FIXME-NEWPARSER: These two methods can go away once old parser is gone.
+    void setAttribute(const QualifiedName& value, bool isCaseInsensitive) { m_selector->setAttribute(value, isCaseInsensitive); }
+    void setAttributeValueMatchingIsCaseInsensitive(bool isCaseInsensitive) { m_selector->setAttributeValueMatchingIsCaseInsensitive(isCaseInsensitive); }
+    
+    void setAttribute(const QualifiedName& value, bool convertToLowercase, CSSSelector::AttributeMatchType type) { m_selector->setAttribute(value, convertToLowercase, type); }
+    
+    void setArgument(const AtomicString& value) { m_selector->setArgument(value); }
+    void setNth(int a, int b) { m_selector->setNth(a, b); }
+    void setMatch(CSSSelector::Match value) { m_selector->setMatch(value); }
+    void setRelation(CSSSelector::RelationType value) { m_selector->setRelation(value); }
+    void setForPage() { m_selector->setForPage(); }
+
+    CSSSelector::Match match() const { return m_selector->match(); }
+    CSSSelector::PseudoElementType pseudoElementType() const { return m_selector->pseudoElementType(); }
+    const CSSSelectorList* selectorList() const { return m_selector->selectorList(); }
+    
+    void setPseudoElementType(CSSSelector::PseudoElementType type) { m_selector->setPseudoElementType(type); }
+
+    void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
+    void setLangArgumentList(std::unique_ptr<Vector<AtomicString>>);
+    void setSelectorList(std::unique_ptr<CSSSelectorList>);
+
+    CSSSelector::PseudoClassType pseudoClassType() const { return m_selector->pseudoClassType(); }
+    bool isCustomPseudoElement() const { return m_selector->isCustomPseudoElement(); }
+
+    bool isPseudoElementCueFunction() const
+    {
+#if ENABLE(VIDEO_TRACK)
+        return m_selector->match() == CSSSelector::PseudoElement && m_selector->pseudoElementType() == CSSSelector::PseudoElementCue;
+#else
+        return false;
+#endif
+    }
+
+    bool hasShadowDescendant() const;
+    bool matchesPseudoElement() const;
+
+    bool isHostPseudoSelector() const;
+
+    // FIXME-NEWPARSER: "slotted" was removed here for now, since it leads to a combinator
+    // connection of ShadowDescendant, and the current shadow DOM code doesn't expect this. When
+    // we do fix this issue, make sure to patch the namespace prependTag code to remove the slotted
+    // special case, since it will be covered by this function once again.
+    bool needsImplicitShadowCombinatorForMatching() const;
+
+    CSSParserSelector* tagHistory() const { return m_tagHistory.get(); }
+    void setTagHistory(std::unique_ptr<CSSParserSelector> selector) { m_tagHistory = WTFMove(selector); }
+    void clearTagHistory() { m_tagHistory.reset(); }
+    void insertTagHistory(CSSSelector::RelationType before, std::unique_ptr<CSSParserSelector>, CSSSelector::RelationType after);
+    void appendTagHistory(CSSSelector::RelationType, std::unique_ptr<CSSParserSelector>);
+    void appendTagHistory(CSSParserSelectorCombinator, std::unique_ptr<CSSParserSelector>);
+    void prependTagSelector(const QualifiedName&, bool tagIsForNamespaceRule = false);
+    std::unique_ptr<CSSParserSelector> releaseTagHistory();
+
+private:
+    std::unique_ptr<CSSSelector> m_selector;
+    std::unique_ptr<CSSParserSelector> m_tagHistory;
+};
+
+inline bool CSSParserSelector::hasShadowDescendant() const
+{
+    return m_selector->relation() == CSSSelector::ShadowDescendant;
+}
+
+inline bool CSSParserSelector::needsImplicitShadowCombinatorForMatching() const
+{
+    return match() == CSSSelector::PseudoElement
+        && (pseudoElementType() == CSSSelector::PseudoElementWebKitCustom
+            || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom
+#if ENABLE(VIDEO_TRACK)
+            || pseudoElementType() == CSSSelector::PseudoElementCue
+#endif
+            || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed);
+}
+
+}

Deleted: trunk/Source/WebCore/css/parser/CSSParserValues.cpp (209670 => 209671)


--- trunk/Source/WebCore/css/parser/CSSParserValues.cpp	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.cpp	2016-12-10 20:38:50 UTC (rev 209671)
@@ -1,245 +0,0 @@
-/*
- * Copyright (C) 2003 Lars Knoll ([email protected])
- * Copyright (C) 2004, 2005, 2006, 2008, 2014 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#include "config.h"
-#include "CSSParserValues.h"
-
-#include "CSSCustomPropertyValue.h"
-#include "CSSParserIdioms.h"
-#include "CSSPrimitiveValue.h"
-#include "CSSFunctionValue.h"
-#include "CSSSelector.h"
-#include "CSSSelectorList.h"
-#include "SelectorPseudoTypeMap.h"
-
-#if COMPILER(MSVC)
-// See https://msdn.microsoft.com/en-us/library/1wea5zwe.aspx
-#pragma warning(disable: 4701)
-#endif
-
-namespace WebCore {
-
-using namespace WTF;
-
-CSSParserSelector* CSSParserSelector::parsePagePseudoSelector(const AtomicString& pseudoTypeString)
-{
-    CSSSelector::PagePseudoClassType pseudoType;
-    if (equalLettersIgnoringASCIICase(pseudoTypeString, "first"))
-        pseudoType = CSSSelector::PagePseudoClassFirst;
-    else if (equalLettersIgnoringASCIICase(pseudoTypeString, "left"))
-        pseudoType = CSSSelector::PagePseudoClassLeft;
-    else if (equalLettersIgnoringASCIICase(pseudoTypeString, "right"))
-        pseudoType = CSSSelector::PagePseudoClassRight;
-    else
-        return nullptr;
-    
-    auto selector = std::make_unique<CSSParserSelector>();
-    selector->m_selector->setMatch(CSSSelector::PagePseudoClass);
-    selector->m_selector->setPagePseudoType(pseudoType);
-    return selector.release();
-}
-
-CSSParserSelector* CSSParserSelector::parsePseudoElementSelectorFromStringView(StringView& pseudoTypeString)
-{
-    AtomicString name = pseudoTypeString.toAtomicString();
-    
-    CSSSelector::PseudoElementType pseudoType = CSSSelector::parsePseudoElementType(name);
-    if (pseudoType == CSSSelector::PseudoElementUnknown) {
-        // FIXME-NEWPARSER: We can't add "slotted" to the map without breaking the old
-        // parser, so this hack ensures the new parser still recognizes it. When the new
-        // parser turns on, we can add "slotted" to the map and remove this code.
-        if (pseudoTypeString.startsWithIgnoringASCIICase("slotted"))
-            pseudoType = CSSSelector::PseudoElementSlotted;
-        else
-            return nullptr;
-    }
-
-    auto selector = std::make_unique<CSSParserSelector>();
-    selector->m_selector->setMatch(CSSSelector::PseudoElement);
-    selector->m_selector->setPseudoElementType(pseudoType);
-    if (pseudoType == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed) {
-        ASSERT_WITH_MESSAGE(name == "-webkit-input-placeholder", "-webkit-input-placeholder is the only LegacyPrefix pseudo type.");
-        if (name == "-webkit-input-placeholder")
-            name = AtomicString("placeholder", AtomicString::ConstructFromLiteral);
-    }
-    selector->m_selector->setValue(name);
-    return selector.release();
-}
-
-CSSParserSelector* CSSParserSelector::parsePseudoClassSelectorFromStringView(StringView& pseudoTypeString)
-{
-    PseudoClassOrCompatibilityPseudoElement pseudoType = parsePseudoClassAndCompatibilityElementString(pseudoTypeString);
-    if (pseudoType.pseudoClass != CSSSelector::PseudoClassUnknown) {
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->m_selector->setMatch(CSSSelector::PseudoClass);
-        selector->m_selector->setPseudoClassType(pseudoType.pseudoClass);
-        return selector.release();
-    }
-    if (pseudoType.compatibilityPseudoElement != CSSSelector::PseudoElementUnknown) {
-        auto selector = std::make_unique<CSSParserSelector>();
-        selector->m_selector->setMatch(CSSSelector::PseudoElement);
-        selector->m_selector->setPseudoElementType(pseudoType.compatibilityPseudoElement);
-        AtomicString name = pseudoTypeString.toAtomicString();
-        selector->m_selector->setValue(name);
-        return selector.release();
-    }
-    return nullptr;
-}
-
-CSSParserSelector::CSSParserSelector()
-    : m_selector(std::make_unique<CSSSelector>())
-{
-}
-
-CSSParserSelector::CSSParserSelector(const QualifiedName& tagQName)
-    : m_selector(std::make_unique<CSSSelector>(tagQName))
-{
-}
-
-CSSParserSelector::~CSSParserSelector()
-{
-    if (!m_tagHistory)
-        return;
-    Vector<std::unique_ptr<CSSParserSelector>, 16> toDelete;
-    std::unique_ptr<CSSParserSelector> selector = WTFMove(m_tagHistory);
-    while (true) {
-        std::unique_ptr<CSSParserSelector> next = WTFMove(selector->m_tagHistory);
-        toDelete.append(WTFMove(selector));
-        if (!next)
-            break;
-        selector = WTFMove(next);
-    }
-}
-
-void CSSParserSelector::adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector)
-{
-    auto selectorList = std::make_unique<CSSSelectorList>();
-    selectorList->adoptSelectorVector(selectorVector);
-    m_selector->setSelectorList(WTFMove(selectorList));
-}
-
-void CSSParserSelector::setLangArgumentList(std::unique_ptr<Vector<AtomicString>> argumentList)
-{
-    ASSERT_WITH_MESSAGE(!argumentList->isEmpty(), "No CSS Selector takes an empty argument list.");
-    m_selector->setLangArgumentList(WTFMove(argumentList));
-}
-
-void CSSParserSelector::setSelectorList(std::unique_ptr<CSSSelectorList> selectorList)
-{
-    m_selector->setSelectorList(WTFMove(selectorList));
-}
-
-static bool selectorListMatchesPseudoElement(const CSSSelectorList* selectorList)
-{
-    if (!selectorList)
-        return false;
-
-    for (const CSSSelector* subSelector = selectorList->first(); subSelector; subSelector = CSSSelectorList::next(subSelector)) {
-        for (const CSSSelector* selector = subSelector; selector; selector = selector->tagHistory()) {
-            if (selector->matchesPseudoElement())
-                return true;
-            if (const CSSSelectorList* subselectorList = selector->selectorList()) {
-                if (selectorListMatchesPseudoElement(subselectorList))
-                    return true;
-            }
-        }
-    }
-    return false;
-}
-
-bool CSSParserSelector::matchesPseudoElement() const
-{
-    return m_selector->matchesPseudoElement() || selectorListMatchesPseudoElement(m_selector->selectorList());
-}
-
-void CSSParserSelector::insertTagHistory(CSSSelector::RelationType before, std::unique_ptr<CSSParserSelector> selector, CSSSelector::RelationType after)
-{
-    if (m_tagHistory)
-        selector->setTagHistory(WTFMove(m_tagHistory));
-    setRelation(before);
-    selector->setRelation(after);
-    m_tagHistory = WTFMove(selector);
-}
-
-void CSSParserSelector::appendTagHistory(CSSSelector::RelationType relation, std::unique_ptr<CSSParserSelector> selector)
-{
-    CSSParserSelector* end = this;
-    while (end->tagHistory())
-        end = end->tagHistory();
-
-    end->setRelation(relation);
-    end->setTagHistory(WTFMove(selector));
-}
-
-void CSSParserSelector::appendTagHistory(CSSParserSelectorCombinator relation, std::unique_ptr<CSSParserSelector> selector)
-{
-    CSSParserSelector* end = this;
-    while (end->tagHistory())
-        end = end->tagHistory();
-
-    CSSSelector::RelationType selectorRelation;
-    switch (relation) {
-    case CSSParserSelectorCombinator::Child:
-        selectorRelation = CSSSelector::Child;
-        break;
-    case CSSParserSelectorCombinator::DescendantSpace:
-        selectorRelation = CSSSelector::DescendantSpace;
-        break;
-#if ENABLE(CSS_SELECTORS_LEVEL4)
-    case CSSParserSelectorCombinator::DescendantDoubleChild:
-        selectorRelation = CSSSelector::DescendantDoubleChild;
-        break;
-#endif
-    case CSSParserSelectorCombinator::DirectAdjacent:
-        selectorRelation = CSSSelector::DirectAdjacent;
-        break;
-    case CSSParserSelectorCombinator::IndirectAdjacent:
-        selectorRelation = CSSSelector::IndirectAdjacent;
-        break;
-    }
-    end->setRelation(selectorRelation);
-    end->setTagHistory(WTFMove(selector));
-}
-
-void CSSParserSelector::prependTagSelector(const QualifiedName& tagQName, bool tagIsForNamespaceRule)
-{
-    auto second = std::make_unique<CSSParserSelector>();
-    second->m_selector = WTFMove(m_selector);
-    second->m_tagHistory = WTFMove(m_tagHistory);
-    m_tagHistory = WTFMove(second);
-
-    m_selector = std::make_unique<CSSSelector>(tagQName, tagIsForNamespaceRule);
-    m_selector->setRelation(CSSSelector::Subselector);
-}
-
-std::unique_ptr<CSSParserSelector> CSSParserSelector::releaseTagHistory()
-{
-    setRelation(CSSSelector::Subselector);
-    return WTFMove(m_tagHistory);
-}
-
-// FIXME-NEWPARSER: Add support for :host-context
-bool CSSParserSelector::isHostPseudoSelector() const
-{
-    return match() == CSSSelector::PseudoClass && pseudoClassType() == CSSSelector::PseudoClassHost;
-}
-
-}
-

Deleted: trunk/Source/WebCore/css/parser/CSSParserValues.h (209670 => 209671)


--- trunk/Source/WebCore/css/parser/CSSParserValues.h	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/parser/CSSParserValues.h	2016-12-10 20:38:50 UTC (rev 209671)
@@ -1,135 +0,0 @@
-/*
- * Copyright (C) 2003 Lars Knoll ([email protected])
- * Copyright (C) 2004, 2005, 2006, 2008, 2009, 2010, 2014 Apple Inc. All rights reserved.
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public License
- * along with this library; see the file COPYING.LIB.  If not, write to
- * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- * Boston, MA 02110-1301, USA.
- */
-
-#pragma once
-
-#include "CSSSelector.h"
-#include "CSSValueKeywords.h"
-#include "CSSValueList.h"
-#include <wtf/text/AtomicString.h>
-#include <wtf/text/AtomicStringHash.h>
-#include <wtf/text/WTFString.h>
-
-namespace WebCore {
-
-class CSSValue;
-class QualifiedName;
-
-enum class CSSParserSelectorCombinator {
-    Child,
-    DescendantSpace,
-#if ENABLE(CSS_SELECTORS_LEVEL4)
-    DescendantDoubleChild,
-#endif
-    DirectAdjacent,
-    IndirectAdjacent
-};
-
-class CSSParserSelector {
-    WTF_MAKE_FAST_ALLOCATED;
-public:
-    static CSSParserSelector* parsePseudoClassSelectorFromStringView(StringView&);
-    static CSSParserSelector* parsePseudoElementSelectorFromStringView(StringView&);
-    static CSSParserSelector* parsePagePseudoSelector(const AtomicString&);
-    
-    CSSParserSelector();
-    explicit CSSParserSelector(const QualifiedName&);
-    ~CSSParserSelector();
-
-    std::unique_ptr<CSSSelector> releaseSelector() { return WTFMove(m_selector); }
-
-    void setValue(const AtomicString& value, bool matchLowerCase = false) { m_selector->setValue(value, matchLowerCase); }
-    
-    // FIXME-NEWPARSER: These two methods can go away once old parser is gone.
-    void setAttribute(const QualifiedName& value, bool isCaseInsensitive) { m_selector->setAttribute(value, isCaseInsensitive); }
-    void setAttributeValueMatchingIsCaseInsensitive(bool isCaseInsensitive) { m_selector->setAttributeValueMatchingIsCaseInsensitive(isCaseInsensitive); }
-    
-    void setAttribute(const QualifiedName& value, bool convertToLowercase, CSSSelector::AttributeMatchType type) { m_selector->setAttribute(value, convertToLowercase, type); }
-    
-    void setArgument(const AtomicString& value) { m_selector->setArgument(value); }
-    void setNth(int a, int b) { m_selector->setNth(a, b); }
-    void setMatch(CSSSelector::Match value) { m_selector->setMatch(value); }
-    void setRelation(CSSSelector::RelationType value) { m_selector->setRelation(value); }
-    void setForPage() { m_selector->setForPage(); }
-
-    CSSSelector::Match match() const { return m_selector->match(); }
-    CSSSelector::PseudoElementType pseudoElementType() const { return m_selector->pseudoElementType(); }
-    const CSSSelectorList* selectorList() const { return m_selector->selectorList(); }
-    
-    void setPseudoElementType(CSSSelector::PseudoElementType type) { m_selector->setPseudoElementType(type); }
-
-    void adoptSelectorVector(Vector<std::unique_ptr<CSSParserSelector>>& selectorVector);
-    void setLangArgumentList(std::unique_ptr<Vector<AtomicString>>);
-    void setSelectorList(std::unique_ptr<CSSSelectorList>);
-
-    CSSSelector::PseudoClassType pseudoClassType() const { return m_selector->pseudoClassType(); }
-    bool isCustomPseudoElement() const { return m_selector->isCustomPseudoElement(); }
-
-    bool isPseudoElementCueFunction() const
-    {
-#if ENABLE(VIDEO_TRACK)
-        return m_selector->match() == CSSSelector::PseudoElement && m_selector->pseudoElementType() == CSSSelector::PseudoElementCue;
-#else
-        return false;
-#endif
-    }
-
-    bool hasShadowDescendant() const;
-    bool matchesPseudoElement() const;
-
-    bool isHostPseudoSelector() const;
-
-    // FIXME-NEWPARSER: "slotted" was removed here for now, since it leads to a combinator
-    // connection of ShadowDescendant, and the current shadow DOM code doesn't expect this. When
-    // we do fix this issue, make sure to patch the namespace prependTag code to remove the slotted
-    // special case, since it will be covered by this function once again.
-    bool needsImplicitShadowCombinatorForMatching() const;
-
-    CSSParserSelector* tagHistory() const { return m_tagHistory.get(); }
-    void setTagHistory(std::unique_ptr<CSSParserSelector> selector) { m_tagHistory = WTFMove(selector); }
-    void clearTagHistory() { m_tagHistory.reset(); }
-    void insertTagHistory(CSSSelector::RelationType before, std::unique_ptr<CSSParserSelector>, CSSSelector::RelationType after);
-    void appendTagHistory(CSSSelector::RelationType, std::unique_ptr<CSSParserSelector>);
-    void appendTagHistory(CSSParserSelectorCombinator, std::unique_ptr<CSSParserSelector>);
-    void prependTagSelector(const QualifiedName&, bool tagIsForNamespaceRule = false);
-    std::unique_ptr<CSSParserSelector> releaseTagHistory();
-
-private:
-    std::unique_ptr<CSSSelector> m_selector;
-    std::unique_ptr<CSSParserSelector> m_tagHistory;
-};
-
-inline bool CSSParserSelector::hasShadowDescendant() const
-{
-    return m_selector->relation() == CSSSelector::ShadowDescendant;
-}
-
-inline bool CSSParserSelector::needsImplicitShadowCombinatorForMatching() const
-{
-    return match() == CSSSelector::PseudoElement
-        && (pseudoElementType() == CSSSelector::PseudoElementWebKitCustom
-            || pseudoElementType() == CSSSelector::PseudoElementUserAgentCustom
-#if ENABLE(VIDEO_TRACK)
-            || pseudoElementType() == CSSSelector::PseudoElementCue
-#endif
-            || pseudoElementType() == CSSSelector::PseudoElementWebKitCustomLegacyPrefixed);
-}
-
-}

Modified: trunk/Source/WebCore/css/parser/CSSSelectorParser.h (209670 => 209671)


--- trunk/Source/WebCore/css/parser/CSSSelectorParser.h	2016-12-10 20:22:37 UTC (rev 209670)
+++ trunk/Source/WebCore/css/parser/CSSSelectorParser.h	2016-12-10 20:38:50 UTC (rev 209671)
@@ -29,8 +29,8 @@
 
 #pragma once
 
+#include "CSSParserSelector.h"
 #include "CSSParserTokenRange.h"
-#include "CSSParserValues.h" // FIXME-NEWPARSER Change when CSSParserSelector moves into its own file.
 #include <memory>
 
 namespace WebCore {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to