Remove SelectRuleFeatureSet
authorantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 02:03:29 +0000 (02:03 +0000)
committerantti@apple.com <antti@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 8 May 2013 02:03:29 +0000 (02:03 +0000)
https://bugs.webkit.org/show_bug.cgi?id=115757

Reviewed by Benjamin Poulain.

This is dead code.

* CMakeLists.txt:
* GNUmakefile.list.am:
* Target.pri:
* WebCore.exp.in:
* WebCore.vcproj/WebCore.vcproj:
* WebCore.xcodeproj/project.pbxproj:
* dom/Element.cpp:
(WebCore::Element::attributeChanged):
(WebCore):
(WebCore::Element::didAffectSelector):
* dom/Element.h:
(Element):
* dom/ElementShadow.h:
(WebCore::ElementShadow::invalidateDistribution):
* html/shadow/ContentDistributor.cpp:
(WebCore::ContentDistributor::ContentDistributor):
(WebCore):
* html/shadow/ContentDistributor.h:
(ContentDistributor):
* html/shadow/InsertionPoint.cpp:
(WebCore::InsertionPoint::insertedInto):
(WebCore::InsertionPoint::removedFrom):
* html/shadow/InsertionPoint.h:
(InsertionPoint):
* html/shadow/SelectRuleFeatureSet.cpp: Removed.
* html/shadow/SelectRuleFeatureSet.h: Removed.
* testing/Internals.cpp:
(WebCore):
* testing/Internals.idl:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@149708 268f45cc-cd09-0410-ab3c-d52691b4dbfc

20 files changed:
Source/WebCore/CMakeLists.txt
Source/WebCore/ChangeLog
Source/WebCore/GNUmakefile.list.am
Source/WebCore/Target.pri
Source/WebCore/WebCore.exp.in
Source/WebCore/WebCore.vcproj/WebCore.vcproj
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/dom/Element.cpp
Source/WebCore/dom/Element.h
Source/WebCore/dom/ElementShadow.h
Source/WebCore/html/shadow/ContentDistributor.cpp
Source/WebCore/html/shadow/ContentDistributor.h
Source/WebCore/html/shadow/InsertionPoint.cpp
Source/WebCore/html/shadow/InsertionPoint.h
Source/WebCore/html/shadow/SelectRuleFeatureSet.cpp [deleted file]
Source/WebCore/html/shadow/SelectRuleFeatureSet.h [deleted file]
Source/WebCore/testing/Internals.cpp
Source/WebCore/testing/Internals.idl
Source/WebKit/WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in
Source/WebKit/win/WebKit.vcproj/WebKitExports.def.in

index 40000fc..12920c2 100644 (file)
@@ -1578,7 +1578,6 @@ set(WebCore_SOURCES
     html/shadow/MediaControlsApple.cpp
     html/shadow/MeterShadowElement.cpp
     html/shadow/ProgressShadowElement.cpp
-    html/shadow/SelectRuleFeatureSet.cpp
     html/shadow/SliderThumbElement.cpp
     html/shadow/SpinButtonElement.cpp
     html/shadow/TextControlInnerElements.cpp
index 116c0fc..5277622 100644 (file)
@@ -1,3 +1,42 @@
+2013-05-07  Antti Koivisto  <antti@apple.com>
+
+        Remove SelectRuleFeatureSet
+        https://bugs.webkit.org/show_bug.cgi?id=115757
+
+        Reviewed by Benjamin Poulain.
+
+        This is dead code.
+
+        * CMakeLists.txt:
+        * GNUmakefile.list.am:
+        * Target.pri:
+        * WebCore.exp.in:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * dom/Element.cpp:
+        (WebCore::Element::attributeChanged):
+        (WebCore):
+        (WebCore::Element::didAffectSelector):
+        * dom/Element.h:
+        (Element):
+        * dom/ElementShadow.h:
+        (WebCore::ElementShadow::invalidateDistribution):
+        * html/shadow/ContentDistributor.cpp:
+        (WebCore::ContentDistributor::ContentDistributor):
+        (WebCore):
+        * html/shadow/ContentDistributor.h:
+        (ContentDistributor):
+        * html/shadow/InsertionPoint.cpp:
+        (WebCore::InsertionPoint::insertedInto):
+        (WebCore::InsertionPoint::removedFrom):
+        * html/shadow/InsertionPoint.h:
+        (InsertionPoint):
+        * html/shadow/SelectRuleFeatureSet.cpp: Removed.
+        * html/shadow/SelectRuleFeatureSet.h: Removed.
+        * testing/Internals.cpp:
+        (WebCore):
+        * testing/Internals.idl:
+
 2013-05-07  Anders Carlsson  <andersca@apple.com>
 
         Store the quotes in the same allocation as the QuotesData object
index 2eb14fd..303c313 100644 (file)
@@ -3750,8 +3750,6 @@ webcore_sources += \
        Source/WebCore/html/shadow/MeterShadowElement.h \
        Source/WebCore/html/shadow/ProgressShadowElement.cpp \
        Source/WebCore/html/shadow/ProgressShadowElement.h \
-       Source/WebCore/html/shadow/SelectRuleFeatureSet.cpp \
-       Source/WebCore/html/shadow/SelectRuleFeatureSet.h \
        Source/WebCore/html/shadow/SliderThumbElement.cpp \
        Source/WebCore/html/shadow/SliderThumbElement.h \
        Source/WebCore/html/shadow/SpinButtonElement.cpp \
index f7937ed..48c6667 100644 (file)
@@ -773,7 +773,6 @@ SOURCES += \
     html/shadow/MediaControlsApple.cpp \
     html/shadow/MeterShadowElement.cpp \
     html/shadow/ProgressShadowElement.cpp \
-    html/shadow/SelectRuleFeatureSet.cpp \
     html/shadow/SliderThumbElement.cpp \
     html/shadow/SpinButtonElement.cpp \
     html/shadow/TextControlInnerElements.cpp \
index aff7fab..aa21de1 100644 (file)
@@ -587,7 +587,6 @@ __ZN7WebCore17languageDidChangeEv
 __ZN7WebCore17openTemporaryFileERKN3WTF6StringERi
 __ZN7WebCore17setCookiesFromDOMERKNS_21NetworkStorageSessionERKNS_4KURLES5_RKN3WTF6StringE
 __ZN7WebCore17userVisibleStringEP5NSURL
-__ZN7WebCore18ContentDistributor22ensureSelectFeatureSetEPNS_13ElementShadowE
 __ZN7WebCore18DOMWindowExtensionC1EPNS_5FrameEPNS_15DOMWrapperWorldE
 __ZN7WebCore18PlatformPasteboard10uniqueNameEv
 __ZN7WebCore18PlatformPasteboard13bufferForTypeERKN3WTF6StringE
index 208536d..8633516 100755 (executable)
                                        >
                                </File>
                                <File
-                                       RelativePath="..\html\shadow\SelectRuleFeatureSet.cpp"
-                                       >
-                               </File>
-                               <File
-                                       RelativePath="..\html\shadow\SelectRuleFeatureSet.h"
-                                       >
-                               </File>
-                               <File
                                        RelativePath="..\html\shadow\SliderThumbElement.cpp"
                                        >
                                </File>
index e2646d7..7396466 100644 (file)
                53EF766C16531994004CBE49 /* SettingsMacros.h in Copy Generated Headers */ = {isa = PBXBuildFile; fileRef = 53EF766A16530A61004CBE49 /* SettingsMacros.h */; };
                550A0BC9085F6039007353D6 /* QualifiedName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 550A0BC7085F6039007353D6 /* QualifiedName.cpp */; };
                550A0BCA085F6039007353D6 /* QualifiedName.h in Headers */ = {isa = PBXBuildFile; fileRef = 550A0BC8085F6039007353D6 /* QualifiedName.h */; settings = {ATTRIBUTES = (Private, ); }; };
-               570B78BF1650CE81001DBE1B /* SelectRuleFeatureSet.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 570B78BD1650CE81001DBE1B /* SelectRuleFeatureSet.cpp */; };
-               570B78C01650CE81001DBE1B /* SelectRuleFeatureSet.h in Headers */ = {isa = PBXBuildFile; fileRef = 570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */; };
                573D134714CE39FF0057ABCA /* InspectorTypeBuilder.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */; };
                578DA20E1520EB8C006141C1 /* InspectorFrontend.h in Headers */ = {isa = PBXBuildFile; fileRef = 4F4F5FFC11CBD30100A186BF /* InspectorFrontend.h */; settings = {ATTRIBUTES = (Private, ); }; };
                578DA20F1520EBA3006141C1 /* InspectorTypeBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = 573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */; settings = {ATTRIBUTES = (Private, ); }; };
                53EF766A16530A61004CBE49 /* SettingsMacros.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SettingsMacros.h; sourceTree = "<group>"; };
                550A0BC7085F6039007353D6 /* QualifiedName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.cpp; path = QualifiedName.cpp; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
                550A0BC8085F6039007353D6 /* QualifiedName.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = QualifiedName.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
-               570B78BD1650CE81001DBE1B /* SelectRuleFeatureSet.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SelectRuleFeatureSet.cpp; sourceTree = "<group>"; };
-               570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SelectRuleFeatureSet.h; sourceTree = "<group>"; };
                573D134514CE39FF0057ABCA /* InspectorTypeBuilder.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InspectorTypeBuilder.cpp; sourceTree = "<group>"; };
                573D134614CE39FF0057ABCA /* InspectorTypeBuilder.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectorTypeBuilder.h; sourceTree = "<group>"; };
                57B7919F14C6A62900F202D1 /* ContentDistributor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ContentDistributor.cpp; sourceTree = "<group>"; };
                                A78E526E1346BD1700AD9C31 /* MeterShadowElement.h */,
                                A715E650134BBBEC00D8E713 /* ProgressShadowElement.cpp */,
                                A715E651134BBBEC00D8E713 /* ProgressShadowElement.h */,
-                               570B78BD1650CE81001DBE1B /* SelectRuleFeatureSet.cpp */,
-                               570B78BE1650CE81001DBE1B /* SelectRuleFeatureSet.h */,
                                4150F9F012B6E0E70008C860 /* SliderThumbElement.cpp */,
                                4150F9EF12B6E0E70008C860 /* SliderThumbElement.h */,
                                4512502015DCE37D002F84E2 /* SpinButtonElement.cpp */,
                                41B8CD4616D04591000E8CC0 /* SelectorCheckerFastPath.h in Headers */,
                                415071581685067300C3C7B3 /* SelectorFilter.h in Headers */,
                                E45322AC140CE267005A0F92 /* SelectorQuery.h in Headers */,
-                               570B78C01650CE81001DBE1B /* SelectRuleFeatureSet.h in Headers */,
                                A75E497610752ACB00C9B896 /* SerializedScriptValue.h in Headers */,
                                93309E10099E64920056E581 /* SetNodeAttributeCommand.h in Headers */,
                                B8DBDB4C130B0F8A00F5CDB1 /* SetSelectionCommand.h in Headers */,
                                41B8CD4516D04591000E8CC0 /* SelectorCheckerFastPath.cpp in Sources */,
                                415071571685067300C3C7B3 /* SelectorFilter.cpp in Sources */,
                                E45322AB140CE267005A0F92 /* SelectorQuery.cpp in Sources */,
-                               570B78BF1650CE81001DBE1B /* SelectRuleFeatureSet.cpp in Sources */,
                                A75E497710752ACB00C9B896 /* SerializedScriptValue.cpp in Sources */,
                                93309E0F099E64920056E581 /* SetNodeAttributeCommand.cpp in Sources */,
                                B8DBDB4B130B0F8A00F5CDB1 /* SetSelectionCommand.cpp in Sources */,
index c9fe6c8..a3384c9 100644 (file)
@@ -851,11 +851,6 @@ static bool checkNeedsStyleInvalidationForIdChange(const AtomicString& oldId, co
 
 void Element::attributeChanged(const QualifiedName& name, const AtomicString& newValue, AttributeModificationReason)
 {
-    if (ElementShadow* parentElementShadow = shadowOfParentForDistribution(this)) {
-        if (shouldInvalidateDistributionWhenAttributeChanged(parentElementShadow, name, newValue))
-            parentElementShadow->invalidateDistribution();
-    }
-
     parseAttribute(name, newValue);
 
     document()->incDOMTreeVersion();
@@ -995,40 +990,6 @@ void Element::classAttributeChanged(const AtomicString& newClassString)
         setNeedsStyleRecalc();
 }
 
-bool Element::shouldInvalidateDistributionWhenAttributeChanged(ElementShadow* elementShadow, const QualifiedName& name, const AtomicString& newValue)
-{
-    ASSERT(elementShadow);
-    const SelectRuleFeatureSet& featureSet = elementShadow->distributor().ensureSelectFeatureSet(elementShadow);
-
-    if (isIdAttributeName(name)) {
-        AtomicString oldId = elementData()->idForStyleResolution();
-        AtomicString newId = makeIdForStyleResolution(newValue, document()->inQuirksMode());
-        if (newId != oldId) {
-            if (!oldId.isEmpty() && featureSet.hasSelectorForId(oldId))
-                return true;
-            if (!newId.isEmpty() && featureSet.hasSelectorForId(newId))
-                return true;
-        }
-    }
-
-    if (name == HTMLNames::classAttr) {
-        const AtomicString& newClassString = newValue;
-        if (classStringHasClassName(newClassString)) {
-            const bool shouldFoldCase = document()->inQuirksMode();
-            const SpaceSplitString& oldClasses = elementData()->classNames();
-            const SpaceSplitString newClasses(newClassString, shouldFoldCase);
-            if (checkSelectorForClassChange(oldClasses, newClasses, featureSet))
-                return true;
-        } else {
-            const SpaceSplitString& oldClasses = elementData()->classNames();
-            if (checkSelectorForClassChange(oldClasses, featureSet))
-                return true;
-        }
-    }
-
-    return featureSet.hasSelectorForAttribute(name.localName());
-}
-
 // Returns true is the given attribute is an event handler.
 // We consider an event handler any attribute that begins with "on".
 // It is a simple solution that has the advantage of not requiring any
@@ -1510,11 +1471,9 @@ ElementShadow* Element::ensureShadow()
     return ensureElementRareData()->ensureShadow();
 }
 
-void Element::didAffectSelector(AffectedSelectorMask mask)
+void Element::didAffectSelector(AffectedSelectorMask)
 {
     setNeedsStyleRecalc();
-    if (ElementShadow* elementShadow = shadowOfParentForDistribution(this))
-        elementShadow->didAffectSelector(mask);
 }
 
 PassRefPtr<ShadowRoot> Element::createShadowRoot(ExceptionCode& ec)
index 8b34a5e..f47755e 100644 (file)
@@ -727,8 +727,6 @@ private:
 
     void createUniqueElementData();
 
-    bool shouldInvalidateDistributionWhenAttributeChanged(ElementShadow*, const QualifiedName&, const AtomicString&);
-
     ElementRareData* elementRareData() const;
     ElementRareData* ensureElementRareData();
 
index 74173c7..3d504e8 100644 (file)
@@ -65,8 +65,6 @@ public:
     void removeAllEventListeners();
 
     void invalidateDistribution() { m_distributor.invalidateDistribution(host()); }
-    void didAffectSelector(AffectedSelectorMask mask) { m_distributor.didAffectSelector(host(), mask); }
-    void willAffectSelector() { m_distributor.willAffectSelector(host()); }
 
     ContentDistributor& distributor() { return m_distributor; }
     const ContentDistributor& distributor() const { return m_distributor; }
index c39fe1b..dbd6d8c 100644 (file)
@@ -151,8 +151,7 @@ bool ScopeContentDistribution::hasInsertionPoint(const ShadowRoot* holder)
 }
 
 ContentDistributor::ContentDistributor()
-    : m_needsSelectFeatureSet(false)
-    , m_validity(Undetermined)
+    : m_validity(Undetermined)
 {
 }
 
@@ -325,57 +324,6 @@ void ContentDistributor::invalidateDistribution(Element* host)
     }
 }
 
-const SelectRuleFeatureSet& ContentDistributor::ensureSelectFeatureSet(ElementShadow* shadow)
-{
-    if (!m_needsSelectFeatureSet)
-        return m_selectFeatures;
-
-    m_selectFeatures.clear();
-    if (ShadowRoot* root = shadow->shadowRoot())
-        collectSelectFeatureSetFrom(root);
-    m_needsSelectFeatureSet = false;
-    return m_selectFeatures;
-}
-
-void ContentDistributor::collectSelectFeatureSetFrom(ShadowRoot* root)
-{
-    if (ScopeContentDistribution::hasElementShadow(root)) {
-        for (Element* element = ElementTraversal::firstWithin(root); element; element = ElementTraversal::next(element)) {
-            if (ElementShadow* elementShadow = element->shadow())
-                m_selectFeatures.add(elementShadow->distributor().ensureSelectFeatureSet(elementShadow));
-        }
-    }
-
-    if (ScopeContentDistribution::hasContentElement(root)) {
-        for (Element* element = ElementTraversal::firstWithin(root); element; element = ElementTraversal::next(element)) {
-            if (!isHTMLContentElement(element))
-                continue;
-            const CSSSelectorList& list = toHTMLContentElement(element)->selectorList();
-            for (const CSSSelector* selector = list.first(); selector; selector = CSSSelectorList::next(selector)) {
-                for (const CSSSelector* component = selector; component; component = component->tagHistory())
-                    m_selectFeatures.collectFeaturesFromSelector(component);
-            }
-        }
-    }
-}
-
-void ContentDistributor::didAffectSelector(Element* host, AffectedSelectorMask mask)
-{
-    if (ensureSelectFeatureSet(host->shadow()).hasSelectorFor(mask))
-        invalidateDistribution(host);
-}
-
-void ContentDistributor::willAffectSelector(Element* host)
-{
-    for (ElementShadow* shadow = host->shadow(); shadow; shadow = shadow->containingShadow()) {
-        if (shadow->distributor().needsSelectFeatureSet())
-            break;
-        shadow->distributor().setNeedsSelectFeatureSet();
-    }
-
-    invalidateDistribution(host);
-}
-
 void ContentDistributor::didShadowBoundaryChange(Element* host)
 {
     setValidity(Undetermined);
index e1d29c9..0d3d192 100644 (file)
@@ -31,7 +31,6 @@
 #ifndef ContentDistributor_h
 #define ContentDistributor_h
 
-#include "SelectRuleFeatureSet.h"
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/RefCounted.h>
@@ -115,15 +114,12 @@ public:
     ~ContentDistributor();
 
     InsertionPoint* findInsertionPointFor(const Node* key) const;
-    const SelectRuleFeatureSet& ensureSelectFeatureSet(ElementShadow*);
 
     void distributeSelectionsTo(InsertionPoint*, const ContentDistribution& pool, Vector<bool>& distributed);
     void distributeNodeChildrenTo(InsertionPoint*, ContainerNode*);
 
     void invalidateDistribution(Element* host);
     void didShadowBoundaryChange(Element* host);
-    void didAffectSelector(Element* host, AffectedSelectorMask);
-    void willAffectSelector(Element* host);
 
     static void ensureDistribution(ShadowRoot*);
 
@@ -132,18 +128,12 @@ private:
     bool invalidate(Element* host);
     void populate(Node*, ContentDistribution&);
 
-    void collectSelectFeatureSetFrom(ShadowRoot*);
-    bool needsSelectFeatureSet() const { return m_needsSelectFeatureSet; }
-    void setNeedsSelectFeatureSet() { m_needsSelectFeatureSet = true; }
-
     void setValidity(Validity validity) { m_validity = validity; }
     bool isValid() const { return m_validity == Valid; }
     bool needsDistribution() const;
     bool needsInvalidation() const { return m_validity != Invalidated; }
 
     HashMap<const Node*, RefPtr<InsertionPoint> > m_nodeToInsertionPoint;
-    SelectRuleFeatureSet m_selectFeatures;
-    bool m_needsSelectFeatureSet : 1;
     unsigned m_validity : 2;
 };
 
index 247fab4..d888ea4 100644 (file)
@@ -134,8 +134,6 @@ Node::InsertionNotificationRequest InsertionPoint::insertedInto(ContainerNode* i
             if (isActive() && !m_registeredWithShadowRoot && insertionPoint->treeScope()->rootNode() == root) {
                 m_registeredWithShadowRoot = true;
                 root->ensureScopeDistribution()->registerInsertionPoint(this);
-                if (canAffectSelector())
-                    rootOwner->willAffectSelector();
             }
         }
     }
@@ -161,8 +159,6 @@ void InsertionPoint::removedFrom(ContainerNode* insertionPoint)
         ASSERT(root);
         m_registeredWithShadowRoot = false;
         root->ensureScopeDistribution()->unregisterInsertionPoint(this);
-        if (rootOwner && canAffectSelector())
-            rootOwner->willAffectSelector();
     }
 
     HTMLElement::removedFrom(insertionPoint);
index 52b13db..4134881 100644 (file)
@@ -66,7 +66,6 @@ public:
     virtual MatchType matchTypeFor(Node*) { return AlwaysMatches; }
     virtual const CSSSelectorList& selectorList() { return emptySelectorList(); }
     virtual Type insertionPointType() const = 0;
-    virtual bool canAffectSelector() const { return false; }
 
     bool resetStyleInheritance() const;
     void setResetStyleInheritance(bool);
diff --git a/Source/WebCore/html/shadow/SelectRuleFeatureSet.cpp b/Source/WebCore/html/shadow/SelectRuleFeatureSet.cpp
deleted file mode 100644 (file)
index 46522c4..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#include "config.h"
-#include "SelectRuleFeatureSet.h"
-
-#include "CSSSelector.h"
-
-namespace WebCore {
-
-SelectRuleFeatureSet::SelectRuleFeatureSet()
-    : m_featureFlags(0)
-{
-}
-
-void SelectRuleFeatureSet::add(const SelectRuleFeatureSet& featureSet)
-{
-    m_cssRuleFeatureSet.add(featureSet.m_cssRuleFeatureSet);
-    m_featureFlags |= featureSet.m_featureFlags;
-}
-
-void SelectRuleFeatureSet::clear()
-{
-    m_cssRuleFeatureSet.clear();
-    m_featureFlags = 0;
-}
-
-void SelectRuleFeatureSet::collectFeaturesFromSelector(const CSSSelector* selector)
-{
-    m_cssRuleFeatureSet.collectFeaturesFromSelector(selector);
-
-    switch (selector->pseudoType()) {
-    case CSSSelector::PseudoChecked:
-        setSelectRuleFeature(AffectedSelectorChecked);
-        break;
-    case CSSSelector::PseudoEnabled:
-        setSelectRuleFeature(AffectedSelectorEnabled);
-        break;
-    case CSSSelector::PseudoDisabled:
-        setSelectRuleFeature(AffectedSelectorDisabled);
-        break;
-    case CSSSelector::PseudoIndeterminate:
-        setSelectRuleFeature(AffectedSelectorIndeterminate);
-        break;
-    case CSSSelector::PseudoLink:
-        setSelectRuleFeature(AffectedSelectorLink);
-        break;
-    case CSSSelector::PseudoTarget:
-        setSelectRuleFeature(AffectedSelectorTarget);
-        break;
-    case CSSSelector::PseudoVisited:
-        setSelectRuleFeature(AffectedSelectorVisited);
-        break;
-    default:
-        break;
-    }
-}
-
-}
-
diff --git a/Source/WebCore/html/shadow/SelectRuleFeatureSet.h b/Source/WebCore/html/shadow/SelectRuleFeatureSet.h
deleted file mode 100644 (file)
index d0f2de6..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright (C) 2012 Google Inc. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions are
- * met:
- *
- *     * Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- *     * Redistributions in binary form must reproduce the above
- * copyright notice, this list of conditions and the following disclaimer
- * in the documentation and/or other materials provided with the
- * distribution.
- *     * Neither the name of Google Inc. nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef SelectRuleFeatureSet_h
-#define SelectRuleFeatureSet_h
-
-#include "Element.h"
-#include "RuleFeature.h"
-
-namespace WebCore {
-
-class SelectRuleFeatureSet {
-public:
-    SelectRuleFeatureSet();
-
-    void add(const SelectRuleFeatureSet&);
-    void clear();
-    void collectFeaturesFromSelector(const CSSSelector*);
-
-    bool hasSelectorForId(const AtomicString&) const;
-    bool hasSelectorForClass(const AtomicString&) const;
-    bool hasSelectorForAttribute(const AtomicString&) const;
-
-    bool hasSelectorForChecked() const { return hasSelectorFor(AffectedSelectorChecked); }
-    bool hasSelectorForEnabled() const { return hasSelectorFor(AffectedSelectorEnabled); }
-    bool hasSelectorForDisabled() const { return hasSelectorFor(AffectedSelectorDisabled); }
-    bool hasSelectorForIndeterminate() const { return hasSelectorFor(AffectedSelectorIndeterminate); }
-    bool hasSelectorForLink() const { return hasSelectorFor(AffectedSelectorLink); }
-    bool hasSelectorForTarget() const { return hasSelectorFor(AffectedSelectorTarget); }
-    bool hasSelectorForVisited() const { return hasSelectorFor(AffectedSelectorVisited); }
-
-    bool hasSelectorFor(AffectedSelectorMask features) const { return m_featureFlags & features; }
-
-private:
-    void setSelectRuleFeature(AffectedSelectorType feature) { m_featureFlags |= feature; }
-
-    RuleFeatureSet m_cssRuleFeatureSet;
-    int m_featureFlags;
-};
-
-inline bool SelectRuleFeatureSet::hasSelectorForId(const AtomicString& idValue) const
-{
-    ASSERT(!idValue.isEmpty());
-    return m_cssRuleFeatureSet.idsInRules.contains(idValue.impl());
-}
-
-inline bool SelectRuleFeatureSet::hasSelectorForClass(const AtomicString& classValue) const
-{
-    ASSERT(!classValue.isEmpty());
-    return m_cssRuleFeatureSet.classesInRules.contains(classValue.impl());
-}
-
-inline bool SelectRuleFeatureSet::hasSelectorForAttribute(const AtomicString& attributeName) const
-{
-    ASSERT(!attributeName.isEmpty());
-    return m_cssRuleFeatureSet.attrsInRules.contains(attributeName.impl());
-}
-
-}
-
-#endif
index efeb926..91641d2 100644 (file)
@@ -85,7 +85,6 @@
 #include "RuntimeEnabledFeatures.h"
 #include "SchemeRegistry.h"
 #include "ScrollingCoordinator.h"
-#include "SelectRuleFeatureSet.h"
 #include "SerializedScriptValue.h"
 #include "Settings.h"
 #include "ShadowRoot.h"
@@ -402,63 +401,6 @@ Node* Internals::parentTreeScope(Node* node, ExceptionCode& ec)
     return parentTreeScope ? parentTreeScope->rootNode() : 0;
 }
 
-bool Internals::hasSelectorForIdInShadow(Element* host, const String& idValue, ExceptionCode& ec)
-{
-    if (!host || !host->shadow()) {
-        ec = INVALID_ACCESS_ERR;
-        return 0;
-    }
-
-    return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).hasSelectorForId(idValue);
-}
-
-bool Internals::hasSelectorForClassInShadow(Element* host, const String& className, ExceptionCode& ec)
-{
-    if (!host || !host->shadow()) {
-        ec = INVALID_ACCESS_ERR;
-        return 0;
-    }
-
-    return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).hasSelectorForClass(className);
-}
-
-bool Internals::hasSelectorForAttributeInShadow(Element* host, const String& attributeName, ExceptionCode& ec)
-{
-    if (!host || !host->shadow()) {
-        ec = INVALID_ACCESS_ERR;
-        return 0;
-    }
-
-    return host->shadow()->distributor().ensureSelectFeatureSet(host->shadow()).hasSelectorForAttribute(attributeName);
-}
-
-bool Internals::hasSelectorForPseudoClassInShadow(Element* host, const String& pseudoClass, ExceptionCode& ec)
-{
-    if (!host || !host->shadow()) {
-        ec = INVALID_ACCESS_ERR;
-        return 0;
-    }
-
-    const SelectRuleFeatureSet& featureSet = host->shadow()->distributor().ensureSelectFeatureSet(host->shadow());
-    if (pseudoClass == "checked")
-        return featureSet.hasSelectorForChecked();
-    if (pseudoClass == "enabled")
-        return featureSet.hasSelectorForEnabled();
-    if (pseudoClass == "disabled")
-        return featureSet.hasSelectorForDisabled();
-    if (pseudoClass == "indeterminate")
-        return featureSet.hasSelectorForIndeterminate();
-    if (pseudoClass == "link")
-        return featureSet.hasSelectorForLink();
-    if (pseudoClass == "target")
-        return featureSet.hasSelectorForTarget();
-    if (pseudoClass == "visited")
-        return featureSet.hasSelectorForVisited();
-
-    ASSERT_NOT_REACHED();
-    return false;
-}
-
 unsigned Internals::numberOfActiveAnimations() const
 {
     Frame* contextFrame = frame();
index 1f0e06c..664b7d2 100644 (file)
     boolean isValidContentSelect(Element contentElement) raises(DOMException);
     Node treeScopeRootNode(Node node) raises (DOMException);
     Node parentTreeScope(Node node) raises (DOMException);
-    boolean hasSelectorForIdInShadow(Element host, DOMString id) raises (DOMException);
-    boolean hasSelectorForClassInShadow(Element host, DOMString className) raises (DOMException);
-    boolean hasSelectorForAttributeInShadow(Element host, DOMString attributeName) raises (DOMException);
-    boolean hasSelectorForPseudoClassInShadow(Element host, DOMString pseudoClass) raises (DOMException);
 
     // CSS Animation testing.
     unsigned long numberOfActiveAnimations();
index 5bce56f..c43e3aa 100644 (file)
@@ -394,7 +394,6 @@ EXPORTS
         ?pseudoElement@Element@WebCore@@QBEPAVPseudoElement@2@W4PseudoId@2@@Z
         ?pauseTransitionAtTime@AnimationController@WebCore@@QAE_NPAVRenderObject@2@ABVString@WTF@@N@Z
         ?addFromLiteralData@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBDI@Z
-        ?ensureSelectFeatureSet@ContentDistributor@WebCore@@QAEABVSelectRuleFeatureSet@2@PAVElementShadow@2@@Z
         ?hasContentElement@ScopeContentDistribution@WebCore@@SA_NPBVShadowRoot@2@@Z
         ?countElementShadow@ScopeContentDistribution@WebCore@@SAIPBVShadowRoot@2@@Z
         ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ
index 5bce56f..c43e3aa 100644 (file)
@@ -394,7 +394,6 @@ EXPORTS
         ?pseudoElement@Element@WebCore@@QBEPAVPseudoElement@2@W4PseudoId@2@@Z
         ?pauseTransitionAtTime@AnimationController@WebCore@@QAE_NPAVRenderObject@2@ABVString@WTF@@N@Z
         ?addFromLiteralData@AtomicString@WTF@@CA?AV?$PassRefPtr@VStringImpl@WTF@@@2@PBDI@Z
-        ?ensureSelectFeatureSet@ContentDistributor@WebCore@@QAEABVSelectRuleFeatureSet@2@PAVElementShadow@2@@Z
         ?hasContentElement@ScopeContentDistribution@WebCore@@SA_NPBVShadowRoot@2@@Z
         ?countElementShadow@ScopeContentDistribution@WebCore@@SAIPBVShadowRoot@2@@Z
         ?memoryCache@WebCore@@YAPAVMemoryCache@1@XZ