Title: [275087] trunk
Revision
275087
Author
[email protected]
Date
2021-03-26 03:16:48 -0700 (Fri, 26 Mar 2021)

Log Message

Remove ASSERT in RenderListItem::computeMarkerStyle
https://bugs.webkit.org/show_bug.cgi?id=222670

Patch by Rob Buis <[email protected]> on 2021-03-26
Reviewed by Ryosuke Niwa.

Source/WebCore:

Remove ASSERT in RenderListItem::computeMarkerStyle
since ::marker does not apply to all elements so
getCachedPseudoStyle can return null.

Test: fast/lists/list-item-compute-marker-style-crash.xhtml

* rendering/RenderListItem.cpp:
(WebCore::RenderListItem::computeMarkerStyle const):

LayoutTests:

* fast/lists/list-item-compute-marker-style-crash-expected.txt: Added.
* fast/lists/list-item-compute-marker-style-crash.xhtml: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (275086 => 275087)


--- trunk/LayoutTests/ChangeLog	2021-03-26 09:42:04 UTC (rev 275086)
+++ trunk/LayoutTests/ChangeLog	2021-03-26 10:16:48 UTC (rev 275087)
@@ -1,3 +1,13 @@
+2021-03-26  Rob Buis  <[email protected]>
+
+        Remove ASSERT in RenderListItem::computeMarkerStyle
+        https://bugs.webkit.org/show_bug.cgi?id=222670
+
+        Reviewed by Ryosuke Niwa.
+
+        * fast/lists/list-item-compute-marker-style-crash-expected.txt: Added.
+        * fast/lists/list-item-compute-marker-style-crash.xhtml: Added.
+
 2021-03-25  Fujii Hironori  <[email protected]>
 
         [WinCairo] Unreviewed test gardening

Added: trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash-expected.txt (0 => 275087)


--- trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash-expected.txt	2021-03-26 10:16:48 UTC (rev 275087)
@@ -0,0 +1,6 @@
+This page contains the following errors:
+
+error on line 15 at column 8: Extra content at the end of the document
+Below is a rendering of the page up to the first error.
+
+This test has PASSED if it does not CRASH.

Added: trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash.xhtml (0 => 275087)


--- trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash.xhtml	                        (rev 0)
+++ trunk/LayoutTests/fast/lists/list-item-compute-marker-style-crash.xhtml	2021-03-26 10:16:48 UTC (rev 275087)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
+<head>
+<style>
+#sb { display: list-item; }
+</style>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>
+</head>
+<body>
+<xul:scrollbox id="sb"/>
+<p>This test has PASSED if it does not CRASH.</p>
+</body>

Modified: trunk/Source/WebCore/ChangeLog (275086 => 275087)


--- trunk/Source/WebCore/ChangeLog	2021-03-26 09:42:04 UTC (rev 275086)
+++ trunk/Source/WebCore/ChangeLog	2021-03-26 10:16:48 UTC (rev 275087)
@@ -1,3 +1,19 @@
+2021-03-26  Rob Buis  <[email protected]>
+
+        Remove ASSERT in RenderListItem::computeMarkerStyle
+        https://bugs.webkit.org/show_bug.cgi?id=222670
+
+        Reviewed by Ryosuke Niwa.
+
+        Remove ASSERT in RenderListItem::computeMarkerStyle
+        since ::marker does not apply to all elements so
+        getCachedPseudoStyle can return null.
+
+        Test: fast/lists/list-item-compute-marker-style-crash.xhtml
+
+        * rendering/RenderListItem.cpp:
+        (WebCore::RenderListItem::computeMarkerStyle const):
+
 2021-03-26  Carlos Garcia Campos  <[email protected]>
 
         REGRESSION(r272301): [SOUP] default port attribute when persisting credential information with libsecret

Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (275086 => 275087)


--- trunk/Source/WebCore/rendering/RenderListItem.cpp	2021-03-26 09:42:04 UTC (rev 275086)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp	2021-03-26 10:16:48 UTC (rev 275087)
@@ -61,9 +61,8 @@
 RenderStyle RenderListItem::computeMarkerStyle() const
 {
     if (!is<PseudoElement>(element())) {
-        auto markerStyle = getCachedPseudoStyle(PseudoId::Marker, &style());
-        ASSERT(markerStyle);
-        return RenderStyle::clone(*markerStyle);
+        if (auto markerStyle = getCachedPseudoStyle(PseudoId::Marker, &style()))
+            return RenderStyle::clone(*markerStyle);
     }
 
     // The marker always inherits from the list item, regardless of where it might end
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to