Title: [293975] trunk
Revision
293975
Author
grao...@webkit.org
Date
2022-05-09 08:17:26 -0700 (Mon, 09 May 2022)

Log Message

REGRESSION (r291817): NativeImage passed to RemoteResourceCacheProxy::recordNativeImageUse may be null
https://bugs.webkit.org/show_bug.cgi?id=239649
rdar://92018859

Reviewed by Dean Jackson.

Test: system-preview/svg-image.html

In the case of an <img> pointing to an SVG resource, the nativeImage() is null. We need to handle this case
properly (filed bug 239673), but for now we can at least not crash.

* platform/graphics/displaylists/DisplayListRecorder.cpp:
(WebCore::DisplayList::Recorder::drawSystemImage):

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

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (293974 => 293975)


--- trunk/LayoutTests/ChangeLog	2022-05-09 14:57:30 UTC (rev 293974)
+++ trunk/LayoutTests/ChangeLog	2022-05-09 15:17:26 UTC (rev 293975)
@@ -1,3 +1,14 @@
+2022-05-09  Antoine Quint  <grao...@apple.com>
+
+        REGRESSION (r291817): NativeImage passed to RemoteResourceCacheProxy::recordNativeImageUse may be null
+        https://bugs.webkit.org/show_bug.cgi?id=239649
+        rdar://92018859
+
+        Reviewed by Dean Jackson.
+
+        * system-preview/svg-image-expected.html: Added.
+        * system-preview/svg-image.html: Added.
+
 2022-05-09  Manuel Rego Casasnovas  <r...@igalia.com>
 
         [WinCairo][WK1] accessibility/aria-combobox-control-owns-elements.html is crashing after 250325@main

Added: trunk/LayoutTests/system-preview/svg-image-expected.html (0 => 293975)


--- trunk/LayoutTests/system-preview/svg-image-expected.html	                        (rev 0)
+++ trunk/LayoutTests/system-preview/svg-image-expected.html	2022-05-09 15:17:26 UTC (rev 293975)
@@ -0,0 +1,3 @@
+<a rel="ar" href=""
+    <div style="width: 400px; height: 400px; background-color: black"></div>
+</a>
\ No newline at end of file

Added: trunk/LayoutTests/system-preview/svg-image.html (0 => 293975)


--- trunk/LayoutTests/system-preview/svg-image.html	                        (rev 0)
+++ trunk/LayoutTests/system-preview/svg-image.html	2022-05-09 15:17:26 UTC (rev 293975)
@@ -0,0 +1,3 @@
+<a rel="ar" href=""
+    <img src="" viewBox='0 0 1 1' xmlns='http://www.w3.org/2000/svg'><rect width='1' height='1'/></svg>" width="400" height="400">
+</a>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (293974 => 293975)


--- trunk/Source/WebCore/ChangeLog	2022-05-09 14:57:30 UTC (rev 293974)
+++ trunk/Source/WebCore/ChangeLog	2022-05-09 15:17:26 UTC (rev 293975)
@@ -1,3 +1,19 @@
+2022-05-09  Antoine Quint  <grao...@apple.com>
+
+        REGRESSION (r291817): NativeImage passed to RemoteResourceCacheProxy::recordNativeImageUse may be null
+        https://bugs.webkit.org/show_bug.cgi?id=239649
+        rdar://92018859
+
+        Reviewed by Dean Jackson.
+
+        Test: system-preview/svg-image.html
+
+        In the case of an <img> pointing to an SVG resource, the nativeImage() is null. We need to handle this case
+        properly (filed bug 239673), but for now we can at least not crash.
+
+        * platform/graphics/displaylists/DisplayListRecorder.cpp:
+        (WebCore::DisplayList::Recorder::drawSystemImage):
+
 2022-05-09  Youenn Fablet  <you...@apple.com>
 
         CoreAudioCaptureSource::settingsDidChange should not reconfigure the audio unit if CoreAudioCaptureSource is not started

Modified: trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp (293974 => 293975)


--- trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-05-09 14:57:30 UTC (rev 293974)
+++ trunk/Source/WebCore/platform/graphics/displaylists/DisplayListRecorder.cpp	2022-05-09 15:17:26 UTC (rev 293975)
@@ -199,8 +199,11 @@
 {
 #if USE(SYSTEM_PREVIEW)
     if (is<ARKitBadgeSystemImage>(systemImage)) {
-        if (auto image = downcast<ARKitBadgeSystemImage>(systemImage).image())
-            recordResourceUse(*image->nativeImage());
+        if (auto image = downcast<ARKitBadgeSystemImage>(systemImage).image()) {
+            if (auto nativeImage = image->nativeImage())
+                recordResourceUse(*nativeImage);
+        }
+        return;
     }
 #endif
     recordDrawSystemImage(systemImage, destinationRect);
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to