Title: [214780] releases/WebKitGTK/webkit-2.16/Source/WebCore
Revision
214780
Author
carlo...@webkit.org
Date
2017-04-03 05:59:28 -0700 (Mon, 03 Apr 2017)

Log Message

Merge r214255 - Use AtomicString in RuleSet and RuleFeature
https://bugs.webkit.org/show_bug.cgi?id=119310
<rdar://problem/28214658>

Reviewed by Andreas Kling.

..instead of the plain AtomicStringImpl*. This introduces some ref churn but not too much.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::ancestorClassRules):
(WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML):
* css/DocumentRuleSets.h:
* css/ElementRuleCollector.cpp:
(WebCore::ElementRuleCollector::collectMatchingRules):
(WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
* css/RuleFeature.cpp:
(WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
(WebCore::makeAttributeSelectorKey):
(WebCore::RuleFeatureSet::collectFeatures):
* css/RuleFeature.h:
* css/RuleSet.cpp:
(WebCore::RuleSet::addToRuleSet):
(WebCore::rulesCountForName):
(WebCore::RuleSet::addRule):
* css/RuleSet.h:
(WebCore::RuleSet::idRules):
(WebCore::RuleSet::classRules):
(WebCore::RuleSet::shadowPseudoElementRules):
(WebCore::RuleSet::tagRules):
* css/StyleResolver.h:
(WebCore::StyleResolver::hasSelectorForAttribute):
(WebCore::StyleResolver::hasSelectorForClass):
(WebCore::StyleResolver::hasSelectorForId):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByAttributeChange):
(WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
* style/IdChangeInvalidation.cpp:
(WebCore::Style::mayBeAffectedByHostRules):
(WebCore::Style::mayBeAffectedBySlottedRules):
(WebCore::Style::IdChangeInvalidation::invalidateStyle):
* style/StyleSharingResolver.cpp:
(WebCore::Style::SharingResolver::resolve):
(WebCore::Style::SharingResolver::canShareStyleWithElement):
(WebCore::Style::SharingResolver::classNamesAffectedByRules):

Modified Paths

Diff

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/ChangeLog	2017-04-03 12:59:28 UTC (rev 214780)
@@ -1,3 +1,50 @@
+2017-03-21  Antti Koivisto  <an...@apple.com>
+
+        Use AtomicString in RuleSet and RuleFeature
+        https://bugs.webkit.org/show_bug.cgi?id=119310
+        <rdar://problem/28214658>
+
+        Reviewed by Andreas Kling.
+
+        ..instead of the plain AtomicStringImpl*. This introduces some ref churn but not too much.
+
+        * css/DocumentRuleSets.cpp:
+        (WebCore::DocumentRuleSets::ancestorClassRules):
+        (WebCore::DocumentRuleSets::ancestorAttributeRulesForHTML):
+        * css/DocumentRuleSets.h:
+        * css/ElementRuleCollector.cpp:
+        (WebCore::ElementRuleCollector::collectMatchingRules):
+        (WebCore::ElementRuleCollector::collectMatchingShadowPseudoElementRules):
+        * css/RuleFeature.cpp:
+        (WebCore::RuleFeatureSet::recursivelyCollectFeaturesFromSelector):
+        (WebCore::makeAttributeSelectorKey):
+        (WebCore::RuleFeatureSet::collectFeatures):
+        * css/RuleFeature.h:
+        * css/RuleSet.cpp:
+        (WebCore::RuleSet::addToRuleSet):
+        (WebCore::rulesCountForName):
+        (WebCore::RuleSet::addRule):
+        * css/RuleSet.h:
+        (WebCore::RuleSet::idRules):
+        (WebCore::RuleSet::classRules):
+        (WebCore::RuleSet::shadowPseudoElementRules):
+        (WebCore::RuleSet::tagRules):
+        * css/StyleResolver.h:
+        (WebCore::StyleResolver::hasSelectorForAttribute):
+        (WebCore::StyleResolver::hasSelectorForClass):
+        (WebCore::StyleResolver::hasSelectorForId):
+        * style/AttributeChangeInvalidation.cpp:
+        (WebCore::Style::mayBeAffectedByAttributeChange):
+        (WebCore::Style::AttributeChangeInvalidation::invalidateStyle):
+        * style/IdChangeInvalidation.cpp:
+        (WebCore::Style::mayBeAffectedByHostRules):
+        (WebCore::Style::mayBeAffectedBySlottedRules):
+        (WebCore::Style::IdChangeInvalidation::invalidateStyle):
+        * style/StyleSharingResolver.cpp:
+        (WebCore::Style::SharingResolver::resolve):
+        (WebCore::Style::SharingResolver::canShareStyleWithElement):
+        (WebCore::Style::SharingResolver::classNamesAffectedByRules):
+
 2017-03-22  Youenn Fablet  <you...@apple.com>
 
         Safari sends empty "Access-Control-Request-Headers" in preflight request

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -124,7 +124,7 @@
     m_features.shrinkToFit();
 }
 
-RuleSet* DocumentRuleSets::ancestorClassRules(AtomicStringImpl* className) const
+RuleSet* DocumentRuleSets::ancestorClassRules(const AtomicString& className) const
 {
     auto addResult = m_ancestorClassRuleSets.add(className, nullptr);
     if (addResult.isNewEntry) {
@@ -134,7 +134,7 @@
     return addResult.iterator->value.get();
 }
 
-const DocumentRuleSets::AttributeRules* DocumentRuleSets::ancestorAttributeRulesForHTML(AtomicStringImpl* attributeName) const
+const DocumentRuleSets::AttributeRules* DocumentRuleSets::ancestorAttributeRulesForHTML(const AtomicString& attributeName) const
 {
     auto addResult = m_ancestorAttributeRuleSetsForHTML.add(attributeName, nullptr);
     auto& value = addResult.iterator->value;

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.h (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.h	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/DocumentRuleSets.h	2017-04-03 12:59:28 UTC (rev 214780)
@@ -49,7 +49,7 @@
     const RuleFeatureSet& features() const;
     RuleSet* sibling() const { return m_siblingRuleSet.get(); }
     RuleSet* uncommonAttribute() const { return m_uncommonAttributeRuleSet.get(); }
-    RuleSet* ancestorClassRules(AtomicStringImpl* className) const;
+    RuleSet* ancestorClassRules(const AtomicString& className) const;
 
     struct AttributeRules {
         WTF_MAKE_FAST_ALLOCATED;
@@ -57,7 +57,7 @@
         Vector<const CSSSelector*> attributeSelectors;
         std::unique_ptr<RuleSet> ruleSet;
     };
-    const AttributeRules* ancestorAttributeRulesForHTML(AtomicStringImpl*) const;
+    const AttributeRules* ancestorAttributeRulesForHTML(const AtomicString&) const;
 
     void initUserStyle(ExtensionStyleSheets&, const MediaQueryEvaluator&, StyleResolver&);
     void resetAuthorStyle();
@@ -77,8 +77,8 @@
     mutable unsigned m_defaultStyleVersionOnFeatureCollection { 0 };
     mutable std::unique_ptr<RuleSet> m_siblingRuleSet;
     mutable std::unique_ptr<RuleSet> m_uncommonAttributeRuleSet;
-    mutable HashMap<AtomicStringImpl*, std::unique_ptr<RuleSet>> m_ancestorClassRuleSets;
-    mutable HashMap<AtomicStringImpl*, std::unique_ptr<AttributeRules>> m_ancestorAttributeRuleSetsForHTML;
+    mutable HashMap<AtomicString, std::unique_ptr<RuleSet>> m_ancestorClassRuleSets;
+    mutable HashMap<AtomicString, std::unique_ptr<AttributeRules>> m_ancestorAttributeRuleSetsForHTML;
 };
 
 inline const RuleFeatureSet& DocumentRuleSets::features() const

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/ElementRuleCollector.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/ElementRuleCollector.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/ElementRuleCollector.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -149,10 +149,10 @@
     // then sort the buffer.
     auto& id = m_element.idForStyleResolution();
     if (!id.isNull())
-        collectMatchingRulesForList(matchRequest.ruleSet->idRules(*id.impl()), matchRequest, ruleRange);
+        collectMatchingRulesForList(matchRequest.ruleSet->idRules(id), matchRequest, ruleRange);
     if (m_element.hasClass()) {
         for (size_t i = 0; i < m_element.classNames().size(); ++i)
-            collectMatchingRulesForList(matchRequest.ruleSet->classRules(m_element.classNames()[i].impl()), matchRequest, ruleRange);
+            collectMatchingRulesForList(matchRequest.ruleSet->classRules(m_element.classNames()[i]), matchRequest, ruleRange);
     }
 
     if (m_element.isLink())
@@ -159,7 +159,7 @@
         collectMatchingRulesForList(matchRequest.ruleSet->linkPseudoClassRules(), matchRequest, ruleRange);
     if (SelectorChecker::matchesFocusPseudoClass(m_element))
         collectMatchingRulesForList(matchRequest.ruleSet->focusPseudoClassRules(), matchRequest, ruleRange);
-    collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName().impl(), m_element.isHTMLElement() && m_element.document().isHTMLDocument()), matchRequest, ruleRange);
+    collectMatchingRulesForList(matchRequest.ruleSet->tagRules(m_element.localName(), m_element.isHTMLElement() && m_element.document().isHTMLDocument()), matchRequest, ruleRange);
     collectMatchingRulesForList(matchRequest.ruleSet->universalRules(), matchRequest, ruleRange);
 }
 
@@ -288,7 +288,7 @@
 #endif
     auto& pseudoId = m_element.shadowPseudoId();
     if (!pseudoId.isEmpty())
-        collectMatchingRulesForList(rules.shadowPseudoElementRules(pseudoId.impl()), matchRequest, ruleRange);
+        collectMatchingRulesForList(rules.shadowPseudoElementRules(pseudoId), matchRequest, ruleRange);
 }
 
 std::unique_ptr<RuleSet::RuleDataVector> ElementRuleCollector::collectSlottedPseudoElementRulesForSlot(bool includeEmptyRules)

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -40,16 +40,16 @@
     const CSSSelector* selector = &firstSelector;
     do {
         if (selector->match() == CSSSelector::Id) {
-            idsInRules.add(selector->value().impl());
+            idsInRules.add(selector->value());
             if (matchesAncestor)
-                idsMatchingAncestorsInRules.add(selector->value().impl());
+                idsMatchingAncestorsInRules.add(selector->value());
         } else if (selector->match() == CSSSelector::Class) {
-            classesInRules.add(selector->value().impl());
+            classesInRules.add(selector->value());
             if (matchesAncestor)
-                selectorFeatures.classesMatchingAncestors.append(selector->value().impl());
+                selectorFeatures.classesMatchingAncestors.append(selector->value());
         } else if (selector->isAttributeSelector()) {
-            auto* canonicalLocalName = selector->attributeCanonicalLocalName().impl();
-            auto* localName = selector->attribute().localName().impl();
+            auto& canonicalLocalName = selector->attributeCanonicalLocalName();
+            auto& localName = selector->attribute().localName();
             attributeCanonicalLocalNamesInRules.add(canonicalLocalName);
             attributeLocalNamesInRules.add(localName);
             if (matchesAncestor)
@@ -99,7 +99,7 @@
         siblingRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
     if (ruleData.containsUncommonAttributeSelector())
         uncommonAttributeRules.append(RuleFeature(ruleData.rule(), ruleData.selectorIndex(), ruleData.hasDocumentSecurityOrigin()));
-    for (auto* className : selectorFeatures.classesMatchingAncestors) {
+    for (auto& className : selectorFeatures.classesMatchingAncestors) {
         auto addResult = ancestorClassRules.ensure(className, [] {
             return std::make_unique<Vector<RuleFeature>>();
         });
@@ -107,7 +107,7 @@
     }
     for (auto* selector : selectorFeatures.attributeSelectorsMatchingAncestors) {
         // Hashing by attributeCanonicalLocalName makes this HTML specific.
-        auto addResult = ancestorAttributeRulesForHTML.ensure(selector->attributeCanonicalLocalName().impl(), [] {
+        auto addResult = ancestorAttributeRulesForHTML.ensure(selector->attributeCanonicalLocalName(), [] {
             return std::make_unique<AttributeRules>();
         });
         auto& rules = *addResult.iterator->value;

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.h (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.h	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleFeature.h	2017-04-03 12:59:28 UTC (rev 214780)
@@ -26,6 +26,7 @@
 #include <wtf/HashMap.h>
 #include <wtf/HashSet.h>
 #include <wtf/text/AtomicString.h>
+#include <wtf/text/AtomicStringHash.h>
 
 namespace WebCore {
 
@@ -50,14 +51,14 @@
     void shrinkToFit();
     void collectFeatures(const RuleData&);
 
-    HashSet<AtomicStringImpl*> idsInRules;
-    HashSet<AtomicStringImpl*> idsMatchingAncestorsInRules;
-    HashSet<AtomicStringImpl*> classesInRules;
-    HashSet<AtomicStringImpl*> attributeCanonicalLocalNamesInRules;
-    HashSet<AtomicStringImpl*> attributeLocalNamesInRules;
+    HashSet<AtomicString> idsInRules;
+    HashSet<AtomicString> idsMatchingAncestorsInRules;
+    HashSet<AtomicString> classesInRules;
+    HashSet<AtomicString> attributeCanonicalLocalNamesInRules;
+    HashSet<AtomicString> attributeLocalNamesInRules;
     Vector<RuleFeature> siblingRules;
     Vector<RuleFeature> uncommonAttributeRules;
-    HashMap<AtomicStringImpl*, std::unique_ptr<Vector<RuleFeature>>> ancestorClassRules;
+    HashMap<AtomicString, std::unique_ptr<Vector<RuleFeature>>> ancestorClassRules;
 
     struct AttributeRules {
         WTF_MAKE_FAST_ALLOCATED;
@@ -66,7 +67,7 @@
         HashMap<SelectorKey, const CSSSelector*> selectors;
         Vector<RuleFeature> features;
     };
-    HashMap<AtomicStringImpl*, std::unique_ptr<AttributeRules>> ancestorAttributeRulesForHTML;
+    HashMap<AtomicString, std::unique_ptr<AttributeRules>> ancestorAttributeRulesForHTML;
     bool usesFirstLineRules { false };
     bool usesFirstLetterRules { false };
 
@@ -73,7 +74,7 @@
 private:
     struct SelectorFeatures {
         bool hasSiblingSelector { false };
-        Vector<AtomicStringImpl*, 32> classesMatchingAncestors;
+        Vector<AtomicString, 32> classesMatchingAncestors;
         Vector<const CSSSelector*> attributeSelectorsMatchingAncestors;
     };
     void recursivelyCollectFeaturesFromSelector(SelectorFeatures&, const CSSSelector&, bool matchesAncestor = false);

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -177,9 +177,9 @@
 {
 }
 
-void RuleSet::addToRuleSet(AtomicStringImpl* key, AtomRuleMap& map, const RuleData& ruleData)
+void RuleSet::addToRuleSet(const AtomicString& key, AtomRuleMap& map, const RuleData& ruleData)
 {
-    if (!key)
+    if (key.isNull())
         return;
     auto& rules = map.add(key, nullptr).iterator->value;
     if (!rules)
@@ -187,7 +187,7 @@
     rules->append(ruleData);
 }
 
-static unsigned rulesCountForName(const RuleSet::AtomRuleMap& map, AtomicStringImpl* name)
+static unsigned rulesCountForName(const RuleSet::AtomRuleMap& map, const AtomicString& name)
 {
     if (const auto* rules = map.get(name))
         return rules->size();
@@ -218,7 +218,7 @@
             idSelector = selector;
             break;
         case CSSSelector::Class: {
-            auto* className = selector->value().impl();
+            auto& className = selector->value();
             if (!classSelector) {
                 classSelector = selector;
                 classBucketSize = rulesCountForName(m_classRules, className);
@@ -305,7 +305,7 @@
     if (customPseudoElementSelector) {
         // FIXME: Custom pseudo elements are handled by the shadow tree's selector filter. It doesn't know about the main DOM.
         ruleData.disableSelectorFiltering();
-        addToRuleSet(customPseudoElementSelector->value().impl(), m_shadowPseudoElementRules, ruleData);
+        addToRuleSet(customPseudoElementSelector->value(), m_shadowPseudoElementRules, ruleData);
         return;
     }
 
@@ -315,12 +315,12 @@
     }
 
     if (idSelector) {
-        addToRuleSet(idSelector->value().impl(), m_idRules, ruleData);
+        addToRuleSet(idSelector->value(), m_idRules, ruleData);
         return;
     }
 
     if (classSelector) {
-        addToRuleSet(classSelector->value().impl(), m_classRules, ruleData);
+        addToRuleSet(classSelector->value(), m_classRules, ruleData);
         return;
     }
 
@@ -335,8 +335,8 @@
     }
 
     if (tagSelector) {
-        addToRuleSet(tagSelector->tagQName().localName().impl(), m_tagLocalNameRules, ruleData);
-        addToRuleSet(tagSelector->tagLowercaseLocalName().impl(), m_tagLowercaseLocalNameRules, ruleData);
+        addToRuleSet(tagSelector->tagQName().localName(), m_tagLocalNameRules, ruleData);
+        addToRuleSet(tagSelector->tagLowercaseLocalName(), m_tagLowercaseLocalNameRules, ruleData);
         return;
     }
 

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.h (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.h	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/RuleSet.h	2017-04-03 12:59:28 UTC (rev 214780)
@@ -27,6 +27,7 @@
 #include <wtf/Forward.h>
 #include <wtf/HashMap.h>
 #include <wtf/text/AtomicString.h>
+#include <wtf/text/AtomicStringHash.h>
 #include <wtf/text/CString.h>
 
 namespace WebCore {
@@ -158,7 +159,7 @@
     ~RuleSet();
 
     typedef Vector<RuleData, 1> RuleDataVector;
-    typedef HashMap<AtomicStringImpl*, std::unique_ptr<RuleDataVector>> AtomRuleMap;
+    typedef HashMap<AtomicString, std::unique_ptr<RuleDataVector>> AtomRuleMap;
 
     void addRulesFromSheet(StyleSheetContents&, const MediaQueryEvaluator&, StyleResolver* = 0);
 
@@ -165,7 +166,7 @@
     void addStyleRule(StyleRule*, AddRuleFlags);
     void addRule(StyleRule*, unsigned selectorIndex, AddRuleFlags);
     void addPageRule(StyleRulePage*);
-    void addToRuleSet(AtomicStringImpl* key, AtomRuleMap&, const RuleData&);
+    void addToRuleSet(const AtomicString& key, AtomRuleMap&, const RuleData&);
     void addRegionRule(StyleRuleRegion*, bool hasDocumentSecurityOrigin);
     void shrinkToFit();
     void disableAutoShrinkToFit() { m_autoShrinkToFitEnabled = false; }
@@ -172,10 +173,10 @@
 
     const RuleFeatureSet& features() const { return m_features; }
 
-    const RuleDataVector* idRules(AtomicStringImpl& key) const { return m_idRules.get(&key); }
-    const RuleDataVector* classRules(AtomicStringImpl* key) const { return m_classRules.get(key); }
-    const RuleDataVector* tagRules(AtomicStringImpl* key, bool isHTMLName) const;
-    const RuleDataVector* shadowPseudoElementRules(AtomicStringImpl* key) const { return m_shadowPseudoElementRules.get(key); }
+    const RuleDataVector* idRules(const AtomicString& key) const { return m_idRules.get(key); }
+    const RuleDataVector* classRules(const AtomicString& key) const { return m_classRules.get(key); }
+    const RuleDataVector* tagRules(const AtomicString& key, bool isHTMLName) const;
+    const RuleDataVector* shadowPseudoElementRules(const AtomicString& key) const { return m_shadowPseudoElementRules.get(key); }
     const RuleDataVector* linkPseudoClassRules() const { return &m_linkPseudoClassRules; }
 #if ENABLE(VIDEO_TRACK)
     const RuleDataVector* cuePseudoRules() const { return &m_cuePseudoRules; }
@@ -215,7 +216,7 @@
     Vector<RuleSetSelectorPair> m_regionSelectorsAndRuleSets;
 };
 
-inline const RuleSet::RuleDataVector* RuleSet::tagRules(AtomicStringImpl* key, bool isHTMLName) const
+inline const RuleSet::RuleDataVector* RuleSet::tagRules(const AtomicString& key, bool isHTMLName) const
 {
     const AtomRuleMap* tagRules;
     if (isHTMLName)

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/css/StyleResolver.h (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/css/StyleResolver.h	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/css/StyleResolver.h	2017-04-03 12:59:28 UTC (rev 214780)
@@ -531,20 +531,20 @@
 {
     ASSERT(!attributeName.isEmpty());
     if (element.isHTMLElement())
-        return m_ruleSets.features().attributeCanonicalLocalNamesInRules.contains(attributeName.impl());
-    return m_ruleSets.features().attributeLocalNamesInRules.contains(attributeName.impl());
+        return m_ruleSets.features().attributeCanonicalLocalNamesInRules.contains(attributeName);
+    return m_ruleSets.features().attributeLocalNamesInRules.contains(attributeName);
 }
 
 inline bool StyleResolver::hasSelectorForClass(const AtomicString& classValue) const
 {
     ASSERT(!classValue.isEmpty());
-    return m_ruleSets.features().classesInRules.contains(classValue.impl());
+    return m_ruleSets.features().classesInRules.contains(classValue);
 }
 
 inline bool StyleResolver::hasSelectorForId(const AtomicString& idValue) const
 {
     ASSERT(!idValue.isEmpty());
-    return m_ruleSets.features().idsInRules.contains(idValue.impl());
+    return m_ruleSets.features().idsInRules.contains(idValue);
 }
 
 inline bool checkRegionSelector(const CSSSelector* regionSelector, const Element* regionElement)

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/style/AttributeChangeInvalidation.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/style/AttributeChangeInvalidation.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/style/AttributeChangeInvalidation.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -39,7 +39,7 @@
 static bool mayBeAffectedByAttributeChange(DocumentRuleSets& ruleSets, bool isHTML, const QualifiedName& attributeName)
 {
     auto& nameSet = isHTML ? ruleSets.features().attributeCanonicalLocalNamesInRules : ruleSets.features().attributeLocalNamesInRules;
-    return nameSet.contains(attributeName.localName().impl());
+    return nameSet.contains(attributeName.localName());
 }
 
 static bool mayBeAffectedByHostRules(const Element& element, const QualifiedName& attributeName)
@@ -96,7 +96,7 @@
     if (!childrenOfType<Element>(m_element).first())
         return;
 
-    auto* attributeRules = ruleSets.ancestorAttributeRulesForHTML(attributeName.localName().impl());
+    auto* attributeRules = ruleSets.ancestorAttributeRulesForHTML(attributeName.localName());
     if (!attributeRules)
         return;
 

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/style/IdChangeInvalidation.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/style/IdChangeInvalidation.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/style/IdChangeInvalidation.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -43,7 +43,7 @@
     auto& shadowRuleSets = shadowRoot->styleScope().resolver().ruleSets();
     if (shadowRuleSets.authorStyle().hostPseudoClassRules().isEmpty())
         return false;
-    return shadowRuleSets.features().idsInRules.contains(changedId.impl());
+    return shadowRuleSets.features().idsInRules.contains(changedId);
 }
 
 static bool mayBeAffectedBySlottedRules(const Element& element, const AtomicString& changedId)
@@ -52,7 +52,7 @@
         auto& ruleSets = shadowRoot->styleScope().resolver().ruleSets();
         if (ruleSets.authorStyle().slottedPseudoElementRules().isEmpty())
             continue;
-        if (ruleSets.features().idsInRules.contains(changedId.impl()))
+        if (ruleSets.features().idsInRules.contains(changedId))
             return true;
     }
     return false;
@@ -65,7 +65,7 @@
 
     auto& ruleSets = m_element.styleResolver().ruleSets();
 
-    bool mayAffectStyle = ruleSets.features().idsInRules.contains(changedId.impl())
+    bool mayAffectStyle = ruleSets.features().idsInRules.contains(changedId)
         || mayBeAffectedByHostRules(m_element, changedId)
         || mayBeAffectedBySlottedRules(m_element, changedId);
 
@@ -81,7 +81,7 @@
 
     // This could be easily optimized for fine-grained descendant invalidation similar to ClassChangeInvalidation.
     // However using ids for dynamic styling is rare and this is probably not worth the memory cost of the required data structures.
-    bool mayAffectDescendantStyle = ruleSets.features().idsMatchingAncestorsInRules.contains(changedId.impl());
+    bool mayAffectDescendantStyle = ruleSets.features().idsMatchingAncestorsInRules.contains(changedId);
     if (mayAffectDescendantStyle)
         m_element.invalidateStyleForSubtree();
     else

Modified: releases/WebKitGTK/webkit-2.16/Source/WebCore/style/StyleSharingResolver.cpp (214779 => 214780)


--- releases/WebKitGTK/webkit-2.16/Source/WebCore/style/StyleSharingResolver.cpp	2017-04-03 12:56:35 UTC (rev 214779)
+++ releases/WebKitGTK/webkit-2.16/Source/WebCore/style/StyleSharingResolver.cpp	2017-04-03 12:59:28 UTC (rev 214780)
@@ -90,7 +90,7 @@
         return nullptr;
     // Ids stop style sharing if they show up in the stylesheets.
     auto& id = element.idForStyleResolution();
-    if (!id.isNull() && m_ruleSets.features().idsInRules.contains(id.impl()))
+    if (!id.isNull() && m_ruleSets.features().idsInRules.contains(id))
         return nullptr;
     if (parentElementPreventsSharing(parentElement))
         return nullptr;
@@ -236,7 +236,7 @@
         return false;
 
     auto& candidateElementId = candidateElement.idForStyleResolution();
-    if (!candidateElementId.isNull() && m_ruleSets.features().idsInRules.contains(candidateElementId.impl()))
+    if (!candidateElementId.isNull() && m_ruleSets.features().idsInRules.contains(candidateElementId))
         return false;
 
     bool isControl = is<HTMLFormControlElement>(candidateElement);
@@ -340,7 +340,7 @@
 bool SharingResolver::classNamesAffectedByRules(const SpaceSplitString& classNames) const
 {
     for (unsigned i = 0; i < classNames.size(); ++i) {
-        if (m_ruleSets.features().classesInRules.contains(classNames[i].impl()))
+        if (m_ruleSets.features().classesInRules.contains(classNames[i]))
             return true;
     }
     return false;
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to