Title: [285395] trunk/Source/WebCore
Revision
285395
Author
[email protected]
Date
2021-11-07 13:29:11 -0800 (Sun, 07 Nov 2021)

Log Message

Pass MatchedProperties PropertyCascade setters
https://bugs.webkit.org/show_bug.cgi?id=232799

Reviewed by Alan Bujtas.

Reduce the number of arguments and make it easier to expand.

* style/PropertyCascade.cpp:
(WebCore::Style::PropertyCascade::setPropertyInternal):
(WebCore::Style::PropertyCascade::set):
(WebCore::Style::PropertyCascade::setDeferred):
(WebCore::Style::PropertyCascade::addMatch):
* style/PropertyCascade.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285394 => 285395)


--- trunk/Source/WebCore/ChangeLog	2021-11-07 21:13:20 UTC (rev 285394)
+++ trunk/Source/WebCore/ChangeLog	2021-11-07 21:29:11 UTC (rev 285395)
@@ -1,3 +1,19 @@
+2021-11-07  Antti Koivisto  <[email protected]>
+
+        Pass MatchedProperties PropertyCascade setters
+        https://bugs.webkit.org/show_bug.cgi?id=232799
+
+        Reviewed by Alan Bujtas.
+
+        Reduce the number of arguments and make it easier to expand.
+
+        * style/PropertyCascade.cpp:
+        (WebCore::Style::PropertyCascade::setPropertyInternal):
+        (WebCore::Style::PropertyCascade::set):
+        (WebCore::Style::PropertyCascade::setDeferred):
+        (WebCore::Style::PropertyCascade::addMatch):
+        * style/PropertyCascade.h:
+
 2021-11-07  Myles C. Maxfield  <[email protected]>
 
         [WebGPU] Add internal WebGPU API interface

Modified: trunk/Source/WebCore/style/PropertyCascade.cpp (285394 => 285395)


--- trunk/Source/WebCore/style/PropertyCascade.cpp	2021-11-07 21:13:20 UTC (rev 285394)
+++ trunk/Source/WebCore/style/PropertyCascade.cpp	2021-11-07 21:29:11 UTC (rev 285395)
@@ -107,21 +107,21 @@
     }
 }
 
-void PropertyCascade::setPropertyInternal(Property& property, CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel, ScopeOrdinal styleScopeOrdinal)
+void PropertyCascade::setPropertyInternal(Property& property, CSSPropertyID id, CSSValue& cssValue, const MatchedProperties& matchedProperties, CascadeLevel cascadeLevel)
 {
-    ASSERT(linkMatchType <= SelectorChecker::MatchAll);
+    ASSERT(matchedProperties.linkMatchType <= SelectorChecker::MatchAll);
     property.id = id;
     property.level = cascadeLevel;
-    property.styleScopeOrdinal = styleScopeOrdinal;
-    if (linkMatchType == SelectorChecker::MatchAll) {
+    property.styleScopeOrdinal = matchedProperties.styleScopeOrdinal;
+    if (matchedProperties.linkMatchType == SelectorChecker::MatchAll) {
         property.cssValue[0] = &cssValue;
         property.cssValue[SelectorChecker::MatchLink] = &cssValue;
         property.cssValue[SelectorChecker::MatchVisited] = &cssValue;
     } else
-        property.cssValue[linkMatchType] = &cssValue;
+        property.cssValue[matchedProperties.linkMatchType] = &cssValue;
 }
 
-void PropertyCascade::set(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel, ScopeOrdinal styleScopeOrdinal)
+void PropertyCascade::set(CSSPropertyID id, CSSValue& cssValue, const MatchedProperties& matchedProperties, CascadeLevel cascadeLevel)
 {
     if (CSSProperty::isDirectionAwareProperty(id)) {
         auto direction = this->direction();
@@ -140,11 +140,11 @@
             Property property;
             property.id = id;
             memset(property.cssValue, 0, sizeof(property.cssValue));
-            setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel, styleScopeOrdinal);
+            setPropertyInternal(property, id, cssValue, matchedProperties, cascadeLevel);
             m_customProperties.set(customValue.name(), property);
         } else {
             Property property = customProperty(customValue.name());
-            setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel, styleScopeOrdinal);
+            setPropertyInternal(property, id, cssValue, matchedProperties, cascadeLevel);
             m_customProperties.set(customValue.name(), property);
         }
         return;
@@ -153,10 +153,10 @@
     if (!m_propertyIsPresent[id])
         memset(property.cssValue, 0, sizeof(property.cssValue));
     m_propertyIsPresent.set(id);
-    setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel, styleScopeOrdinal);
+    setPropertyInternal(property, id, cssValue, matchedProperties, cascadeLevel);
 }
 
-void PropertyCascade::setDeferred(CSSPropertyID id, CSSValue& cssValue, unsigned linkMatchType, CascadeLevel cascadeLevel, ScopeOrdinal styleScopeOrdinal)
+void PropertyCascade::setDeferred(CSSPropertyID id, CSSValue& cssValue, const MatchedProperties& matchedProperties, CascadeLevel cascadeLevel)
 {
     ASSERT(!CSSProperty::isDirectionAwareProperty(id));
     ASSERT(shouldApplyPropertyInParseOrder(id));
@@ -163,7 +163,7 @@
 
     Property property;
     memset(property.cssValue, 0, sizeof(property.cssValue));
-    setPropertyInternal(property, id, cssValue, linkMatchType, cascadeLevel, styleScopeOrdinal);
+    setPropertyInternal(property, id, cssValue, matchedProperties, cascadeLevel);
     m_deferredProperties.append(property);
 }
 
@@ -198,9 +198,9 @@
             continue;
 
         if (shouldApplyPropertyInParseOrder(propertyID))
-            setDeferred(propertyID, *current.value(), matchedProperties.linkMatchType, cascadeLevel, matchedProperties.styleScopeOrdinal);
+            setDeferred(propertyID, *current.value(), matchedProperties, cascadeLevel);
         else
-            set(propertyID, *current.value(), matchedProperties.linkMatchType, cascadeLevel, matchedProperties.styleScopeOrdinal);
+            set(propertyID, *current.value(), matchedProperties, cascadeLevel);
     }
 
     return hasImportantProperties;

Modified: trunk/Source/WebCore/style/PropertyCascade.h (285394 => 285395)


--- trunk/Source/WebCore/style/PropertyCascade.h	2021-11-07 21:13:20 UTC (rev 285394)
+++ trunk/Source/WebCore/style/PropertyCascade.h	2021-11-07 21:29:11 UTC (rev 285395)
@@ -77,9 +77,9 @@
     void addImportantMatches(CascadeLevel);
     bool addMatch(const MatchedProperties&, CascadeLevel, bool important);
 
-    void set(CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel, ScopeOrdinal);
-    void setDeferred(CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel, ScopeOrdinal);
-    static void setPropertyInternal(Property&, CSSPropertyID, CSSValue&, unsigned linkMatchType, CascadeLevel, ScopeOrdinal);
+    void set(CSSPropertyID, CSSValue&, const MatchedProperties&, CascadeLevel);
+    void setDeferred(CSSPropertyID, CSSValue&, const MatchedProperties&, CascadeLevel);
+    static void setPropertyInternal(Property&, CSSPropertyID, CSSValue&, const MatchedProperties&, CascadeLevel);
 
     Direction resolveDirectionAndWritingMode(Direction inheritedDirection) const;
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to