Title: [285714] trunk/Source/WebCore
Revision
285714
Author
[email protected]
Date
2021-11-12 04:48:43 -0800 (Fri, 12 Nov 2021)

Log Message

Re-use isCSSWideKeyword in CSSCustomPropertyValue::createWithID
https://bugs.webkit.org/show_bug.cgi?id=233035

Reviewed by Antti Koivisto.

* css/CSSCustomPropertyValue.cpp:
(WebCore::CSSCustomPropertyValue::createWithID):
* css/CSSCustomPropertyValue.h:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (285713 => 285714)


--- trunk/Source/WebCore/ChangeLog	2021-11-12 12:28:01 UTC (rev 285713)
+++ trunk/Source/WebCore/ChangeLog	2021-11-12 12:48:43 UTC (rev 285714)
@@ -1,3 +1,14 @@
+2021-11-12  Tim Nguyen  <[email protected]>
+
+        Re-use isCSSWideKeyword in CSSCustomPropertyValue::createWithID
+        https://bugs.webkit.org/show_bug.cgi?id=233035
+
+        Reviewed by Antti Koivisto.
+
+        * css/CSSCustomPropertyValue.cpp:
+        (WebCore::CSSCustomPropertyValue::createWithID):
+        * css/CSSCustomPropertyValue.h:
+
 2021-11-12  Antti Koivisto  <[email protected]>
 
         Stack overflow with revert and revert-layer

Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp (285713 => 285714)


--- trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp	2021-11-12 12:28:01 UTC (rev 285713)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.cpp	2021-11-12 12:48:43 UTC (rev 285714)
@@ -26,6 +26,7 @@
 #include "config.h"
 #include "CSSCustomPropertyValue.h"
 
+#include "CSSParserIdioms.h"
 #include "CSSTokenizer.h"
 
 namespace WebCore {
@@ -35,6 +36,12 @@
     return adoptRef(*new CSSCustomPropertyValue(name, std::monostate { }));
 }
 
+Ref<CSSCustomPropertyValue> CSSCustomPropertyValue::createWithID(const AtomString& name, CSSValueID id)
+{
+    ASSERT(WebCore::isCSSWideKeyword(id) || id == CSSValueInvalid);
+    return adoptRef(*new CSSCustomPropertyValue(name, { id }));
+}
+
 bool CSSCustomPropertyValue::equals(const CSSCustomPropertyValue& other) const
 {
     if (m_name != other.m_name || m_value.index() != other.m_value.index())

Modified: trunk/Source/WebCore/css/CSSCustomPropertyValue.h (285713 => 285714)


--- trunk/Source/WebCore/css/CSSCustomPropertyValue.h	2021-11-12 12:28:01 UTC (rev 285713)
+++ trunk/Source/WebCore/css/CSSCustomPropertyValue.h	2021-11-12 12:48:43 UTC (rev 285714)
@@ -52,17 +52,13 @@
         return adoptRef(*new CSSCustomPropertyValue(name, { value }));
     }
 
-    static Ref<CSSCustomPropertyValue> createWithID(const AtomString& name, CSSValueID id)
-    {
-        ASSERT(id == CSSValueInherit || id == CSSValueInitial || id == CSSValueUnset || id == CSSValueRevert || id == CSSValueInvalid);
-        return adoptRef(*new CSSCustomPropertyValue(name, { id }));
-    }
+    static Ref<CSSCustomPropertyValue> createWithID(const AtomString& name, CSSValueID);
 
     static Ref<CSSCustomPropertyValue> createSyntaxAll(const AtomString& name, Ref<CSSVariableData>&& value)
     {
         return adoptRef(*new CSSCustomPropertyValue(name, { WTFMove(value) }));
     }
-    
+
     static Ref<CSSCustomPropertyValue> createSyntaxLength(const AtomString& name, Length value)
     {
         ASSERT(!value.isUndefined());
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to