Title: [294606] trunk
Revision
294606
Author
achristen...@apple.com
Date
2022-05-20 19:25:01 -0700 (Fri, 20 May 2022)

Log Message

Fix invalid assertion in parseKeywordValue
https://bugs.webkit.org/show_bug.cgi?id=240593

Reviewed by Antti Koivisto.

Test: fast/css/parse-non-descriptor.html

* Source/WebCore/css/parser/CSSParserFastPaths.cpp:
This function returns null, which is fine.

Canonical link: https://commits.webkit.org/250831@main

Modified Paths

Added Paths

Diff

Added: trunk/LayoutTests/fast/css/parse-non-descriptor-expected.txt (0 => 294606)


--- trunk/LayoutTests/fast/css/parse-non-descriptor-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/parse-non-descriptor-expected.txt	2022-05-21 02:25:01 UTC (rev 294606)
@@ -0,0 +1 @@
+This test passes if it does not assert.

Added: trunk/LayoutTests/fast/css/parse-non-descriptor.html (0 => 294606)


--- trunk/LayoutTests/fast/css/parse-non-descriptor.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/parse-non-descriptor.html	2022-05-21 02:25:01 UTC (rev 294606)
@@ -0,0 +1,8 @@
+<script>
+    if (window.testRunner) { testRunner.dumpAsText() }
+    _onload_ = function() {
+        body.style.setProperty('src', 'url(#abc)')
+    }
+</script>
+<body id='body'>
+This test passes if it does not assert.

Modified: trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp (294605 => 294606)


--- trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2022-05-21 02:24:37 UTC (rev 294605)
+++ trunk/Source/WebCore/css/parser/CSSParserFastPaths.cpp	2022-05-21 02:25:01 UTC (rev 294606)
@@ -1090,7 +1090,8 @@
     ASSERT(!string.isEmpty());
 
     bool parsingDescriptor = context.enclosingRuleType && *context.enclosingRuleType != StyleRuleType::Style;
-    ASSERT(!CSSProperty::isDescriptorOnly(propertyId) || parsingDescriptor);
+    // FIXME: The "!context.enclosingRuleType" is suspicious.
+    ASSERT(!CSSProperty::isDescriptorOnly(propertyId) || parsingDescriptor || !context.enclosingRuleType);
 
     if (!CSSParserFastPaths::isKeywordPropertyID(propertyId)) {
         // All properties, including non-keyword properties, accept the CSS-wide keywords.
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to