Title: [280599] trunk
Revision
280599
Author
an...@apple.com
Date
2021-08-03 09:54:57 -0700 (Tue, 03 Aug 2021)

Log Message

REGRESSION(r279050): Crash under CSSImageValue::createDeprecatedCSSOMWrapper with cursor images
https://bugs.webkit.org/show_bug.cgi?id=228735

Reviewed by Alex Christensen.

Source/WebCore:

CSSCursorImageValue is not a CSSImageValue. This used to work before r279050 because they had
the URL field in the same offset.

Test: fast/css/cursor-image-cssvalue.html

* css/CSSValue.cpp:
(WebCore::CSSValue::createDeprecatedCSSOMWrapper const):

Don't do any special handling for CSSCursorImageValue. They are exposed as generic (deprecated)
CSS values with cssText only.

LayoutTests:

* fast/css/cursor-image-cssvalue-expected.txt: Added.
* fast/css/cursor-image-cssvalue.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (280598 => 280599)


--- trunk/LayoutTests/ChangeLog	2021-08-03 16:51:54 UTC (rev 280598)
+++ trunk/LayoutTests/ChangeLog	2021-08-03 16:54:57 UTC (rev 280599)
@@ -1,3 +1,13 @@
+2021-08-03  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION(r279050): Crash under CSSImageValue::createDeprecatedCSSOMWrapper with cursor images
+        https://bugs.webkit.org/show_bug.cgi?id=228735
+
+        Reviewed by Alex Christensen.
+
+        * fast/css/cursor-image-cssvalue-expected.txt: Added.
+        * fast/css/cursor-image-cssvalue.html: Added.
+
 2021-08-03  Cathie Chen  <cathiec...@igalia.com>
 
         Import css/css-sizing/aspect-ratio tests from WPT

Added: trunk/LayoutTests/fast/css/cursor-image-cssvalue-expected.txt (0 => 280599)


--- trunk/LayoutTests/fast/css/cursor-image-cssvalue-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css/cursor-image-cssvalue-expected.txt	2021-08-03 16:54:57 UTC (rev 280599)
@@ -0,0 +1 @@
+url("file:///non-existent.png")

Added: trunk/LayoutTests/fast/css/cursor-image-cssvalue.html (0 => 280599)


--- trunk/LayoutTests/fast/css/cursor-image-cssvalue.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css/cursor-image-cssvalue.html	2021-08-03 16:54:57 UTC (rev 280599)
@@ -0,0 +1,13 @@
+<style>
+#target { cursor:url(file:///non-existent.png), auto; }
+</style>
+<div id=target></div>
+<pre id=log></pre>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+
+const cursorValue = getComputedStyle(target).getPropertyCSSValue("cursor");
+
+log.innerText = cursorValue.item(0).cssText;
+</script>

Modified: trunk/Source/WebCore/ChangeLog (280598 => 280599)


--- trunk/Source/WebCore/ChangeLog	2021-08-03 16:51:54 UTC (rev 280598)
+++ trunk/Source/WebCore/ChangeLog	2021-08-03 16:54:57 UTC (rev 280599)
@@ -1,3 +1,21 @@
+2021-08-03  Antti Koivisto  <an...@apple.com>
+
+        REGRESSION(r279050): Crash under CSSImageValue::createDeprecatedCSSOMWrapper with cursor images
+        https://bugs.webkit.org/show_bug.cgi?id=228735
+
+        Reviewed by Alex Christensen.
+
+        CSSCursorImageValue is not a CSSImageValue. This used to work before r279050 because they had
+        the URL field in the same offset.
+
+        Test: fast/css/cursor-image-cssvalue.html
+
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::createDeprecatedCSSOMWrapper const):
+
+        Don't do any special handling for CSSCursorImageValue. They are exposed as generic (deprecated)
+        CSS values with cssText only.
+
 2021-08-03  Alex Christensen  <achristen...@webkit.org>
 
         Use WeakPtr instead of manual raw pointer management in URLSearchParams

Modified: trunk/Source/WebCore/css/CSSValue.cpp (280598 => 280599)


--- trunk/Source/WebCore/css/CSSValue.cpp	2021-08-03 16:51:54 UTC (rev 280598)
+++ trunk/Source/WebCore/css/CSSValue.cpp	2021-08-03 16:54:57 UTC (rev 280599)
@@ -493,7 +493,7 @@
 
 Ref<DeprecatedCSSOMValue> CSSValue::createDeprecatedCSSOMWrapper(CSSStyleDeclaration& styleDeclaration) const
 {
-    if (isImageValue() || isCursorImageValue())
+    if (isImageValue())
         return downcast<CSSImageValue>(this)->createDeprecatedCSSOMWrapper(styleDeclaration);
     if (isPrimitiveValue())
         return DeprecatedCSSOMPrimitiveValue::create(downcast<CSSPrimitiveValue>(*this), styleDeclaration);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to