Title: [250092] trunk/Source/WebCore
Revision
250092
Author
[email protected]
Date
2019-09-19 08:52:43 -0700 (Thu, 19 Sep 2019)

Log Message

Turn static DocumentRuleSets::s_isInvalidatingStyleWithRuleSets assertion bit into a member
https://bugs.webkit.org/show_bug.cgi?id=201985
<rdar://problem/54851871>

Reviewed by Zalan Bujtas.

This assert bit was catching cases that are not dangerous. Turn it into a member to narrow the scope.

* css/DocumentRuleSets.cpp:
(WebCore::DocumentRuleSets::~DocumentRuleSets):
(WebCore::DocumentRuleSets::collectFeatures const):
(): Deleted.
* css/DocumentRuleSets.h:
(WebCore::DocumentRuleSets::isInvalidatingStyleWithRuleSets):
* style/AttributeChangeInvalidation.cpp:
(WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
* style/ClassChangeInvalidation.cpp:
(WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (250091 => 250092)


--- trunk/Source/WebCore/ChangeLog	2019-09-19 15:35:30 UTC (rev 250091)
+++ trunk/Source/WebCore/ChangeLog	2019-09-19 15:52:43 UTC (rev 250092)
@@ -1,3 +1,24 @@
+2019-09-19  Antti Koivisto  <[email protected]>
+
+        Turn static DocumentRuleSets::s_isInvalidatingStyleWithRuleSets assertion bit into a member
+        https://bugs.webkit.org/show_bug.cgi?id=201985
+        <rdar://problem/54851871>
+
+        Reviewed by Zalan Bujtas.
+
+        This assert bit was catching cases that are not dangerous. Turn it into a member to narrow the scope.
+
+        * css/DocumentRuleSets.cpp:
+        (WebCore::DocumentRuleSets::~DocumentRuleSets):
+        (WebCore::DocumentRuleSets::collectFeatures const):
+        (): Deleted.
+        * css/DocumentRuleSets.h:
+        (WebCore::DocumentRuleSets::isInvalidatingStyleWithRuleSets):
+        * style/AttributeChangeInvalidation.cpp:
+        (WebCore::Style::AttributeChangeInvalidation::invalidateStyleWithRuleSets):
+        * style/ClassChangeInvalidation.cpp:
+        (WebCore::Style::ClassChangeInvalidation::invalidateStyleWithRuleSets):
+
 2019-09-19  Zalan Bujtas  <[email protected]>
 
         [LFC] Remove redundant Layout::Box::ElementTypes

Modified: trunk/Source/WebCore/css/DocumentRuleSets.cpp (250091 => 250092)


--- trunk/Source/WebCore/css/DocumentRuleSets.cpp	2019-09-19 15:35:30 UTC (rev 250091)
+++ trunk/Source/WebCore/css/DocumentRuleSets.cpp	2019-09-19 15:52:43 UTC (rev 250092)
@@ -37,9 +37,6 @@
 
 namespace WebCore {
 
-// For catching <rdar://problem/53413013>
-bool DocumentRuleSets::s_isInvalidatingStyleWithRuleSets { false };
-
 DocumentRuleSets::DocumentRuleSets(StyleResolver& styleResolver)
     : m_styleResolver(styleResolver)
 {
@@ -49,7 +46,7 @@
 
 DocumentRuleSets::~DocumentRuleSets()
 {
-    RELEASE_ASSERT(!s_isInvalidatingStyleWithRuleSets);
+    RELEASE_ASSERT(!m_isInvalidatingStyleWithRuleSets);
 }
 
 RuleSet* DocumentRuleSets::userAgentMediaQueryStyle() const
@@ -154,7 +151,7 @@
 
 void DocumentRuleSets::collectFeatures() const
 {
-    RELEASE_ASSERT(!s_isInvalidatingStyleWithRuleSets);
+    RELEASE_ASSERT(!m_isInvalidatingStyleWithRuleSets);
 
     m_features.clear();
     // Collect all ids and rules using sibling selectors (:first-child and similar)

Modified: trunk/Source/WebCore/css/DocumentRuleSets.h (250091 => 250092)


--- trunk/Source/WebCore/css/DocumentRuleSets.h	2019-09-19 15:35:30 UTC (rev 250091)
+++ trunk/Source/WebCore/css/DocumentRuleSets.h	2019-09-19 15:52:43 UTC (rev 250092)
@@ -76,7 +76,7 @@
 
     RuleFeatureSet& mutableFeatures();
 
-    static bool s_isInvalidatingStyleWithRuleSets;
+    bool& isInvalidatingStyleWithRuleSets() { return m_isInvalidatingStyleWithRuleSets; }
 
 private:
     void collectFeatures() const;
@@ -102,6 +102,9 @@
     bool m_usesSharedUserStyle { false };
     bool m_isForShadowScope { false };
     bool m_isAuthorStyleDefined { false };
+
+    // For catching <rdar://problem/53413013>
+    bool m_isInvalidatingStyleWithRuleSets { false };
 };
 
 inline const RuleFeatureSet& DocumentRuleSets::features() const

Modified: trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp (250091 => 250092)


--- trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp	2019-09-19 15:35:30 UTC (rev 250091)
+++ trunk/Source/WebCore/style/AttributeChangeInvalidation.cpp	2019-09-19 15:52:43 UTC (rev 250092)
@@ -89,7 +89,7 @@
 
 void AttributeChangeInvalidation::invalidateStyleWithRuleSets()
 {
-    SetForScope<bool> isInvalidating(DocumentRuleSets::s_isInvalidatingStyleWithRuleSets, true);
+    SetForScope<bool> isInvalidating(m_element.styleResolver().ruleSets().isInvalidatingStyleWithRuleSets(), true);
 
     for (auto* invalidationRuleSet : m_invalidationRuleSets) {
         Invalidator invalidator(*invalidationRuleSet->ruleSet);

Modified: trunk/Source/WebCore/style/ClassChangeInvalidation.cpp (250091 => 250092)


--- trunk/Source/WebCore/style/ClassChangeInvalidation.cpp	2019-09-19 15:35:30 UTC (rev 250091)
+++ trunk/Source/WebCore/style/ClassChangeInvalidation.cpp	2019-09-19 15:52:43 UTC (rev 250092)
@@ -120,7 +120,7 @@
 
 void ClassChangeInvalidation::invalidateStyleWithRuleSets()
 {
-    SetForScope<bool> isInvalidating(DocumentRuleSets::s_isInvalidatingStyleWithRuleSets, true);
+    SetForScope<bool> isInvalidating(m_element.styleResolver().ruleSets().isInvalidatingStyleWithRuleSets(), true);
 
     for (auto* invalidationRuleSet : m_invalidationRuleSets) {
         Invalidator invalidator(*invalidationRuleSet->ruleSet);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to