Title: [244005] releases/WebKitGTK/webkit-2.24
Revision
244005
Author
[email protected]
Date
2019-04-08 05:38:56 -0700 (Mon, 08 Apr 2019)

Log Message

Merge r242943 - Cleanup inline boxes when list marker gets blockified
https://bugs.webkit.org/show_bug.cgi?id=195746
<rdar://problem/48049175>

Reviewed by Antti Koivisto.

Source/WebCore:

Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
change does not require a new renderer.
This patch takes care of destroying the inline boxtree when the marker gains block display type.

Test: fast/block/float/list-marker-is-float-crash.html

* rendering/RenderListMarker.cpp:
(WebCore::RenderListMarker::styleDidChange):

LayoutTests:

* fast/block/float/list-marker-is-float-crash-expected.txt: Added.
* fast/block/float/list-marker-is-float-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog (244004 => 244005)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-04-08 12:38:52 UTC (rev 244004)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/ChangeLog	2019-04-08 12:38:56 UTC (rev 244005)
@@ -1,3 +1,14 @@
+2019-03-14  Zalan Bujtas  <[email protected]>
+
+        Cleanup inline boxes when list marker gets blockified
+        https://bugs.webkit.org/show_bug.cgi?id=195746
+        <rdar://problem/48049175>
+
+        Reviewed by Antti Koivisto.
+
+        * fast/block/float/list-marker-is-float-crash-expected.txt: Added.
+        * fast/block/float/list-marker-is-float-crash.html: Added.
+
 2019-03-13  Zalan Bujtas  <[email protected]>
 
         Use RenderBox::previousSiblingBox/nextSiblingBox in RenderMultiColumnFlow

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt (0 => 244005)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt	2019-04-08 12:38:56 UTC (rev 244005)
@@ -0,0 +1,2 @@
+PASS if no crash.
+

Added: releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash.html (0 => 244005)


--- releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash.html	                        (rev 0)
+++ releases/WebKitGTK/webkit-2.24/LayoutTests/fast/block/float/list-marker-is-float-crash.html	2019-04-08 12:38:56 UTC (rev 244005)
@@ -0,0 +1,14 @@
+PASS if no crash.
+<li>
+<video src=""
 AAAQAAAAAAQAABgAAAAABAAACAAAAABxzdHNjAAAAAAAAAAEAAAABAAAAAwAAAAEAAAAgc3RzegAAAAAAAAAAAAAAAwAAA3MAAAAMAAAADAAAABRzdGNvAAAAAAAAAAEAAAAwAAAAYnVkdGEAAABabWV0YQAAAAAAAAAhaGRscgAAAAAAAAAAbWRpcmFwcGwAAAAAAAAAAAAAAAAtaWxzdAAAACWpdG9vAAAAHWRhdGEAAAABAAAAAExhdmY1Ni40MC4xMDE=" controls="controls">
+<style>
+:matches(::marker, |*) { 
+	float: left;
+}
+</style>
+
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+document.body.style.columnCount = "2";
+</script>
\ No newline at end of file

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog (244004 => 244005)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 12:38:52 UTC (rev 244004)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/ChangeLog	2019-04-08 12:38:56 UTC (rev 244005)
@@ -1,3 +1,21 @@
+2019-03-14  Zalan Bujtas  <[email protected]>
+
+        Cleanup inline boxes when list marker gets blockified
+        https://bugs.webkit.org/show_bug.cgi?id=195746
+        <rdar://problem/48049175>
+
+        Reviewed by Antti Koivisto.
+
+        Normally when an element gets blockified (inline -> block) we destroy its renderer and construct a new one (RenderInline -> RenderBlock).
+        During this process the associated inline boxtree gets destroyed as well. Since RenderListMarker is just a generic RenderBox, the blockifying
+        change does not require a new renderer.
+        This patch takes care of destroying the inline boxtree when the marker gains block display type. 
+
+        Test: fast/block/float/list-marker-is-float-crash.html
+
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::styleDidChange):
+
 2019-03-13  Zalan Bujtas  <[email protected]>
 
         [WeakPtr] RenderListMarker::m_listItem should be a WeakPtr

Modified: releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderListMarker.cpp (244004 => 244005)


--- releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderListMarker.cpp	2019-04-08 12:38:52 UTC (rev 244004)
+++ releases/WebKitGTK/webkit-2.24/Source/WebCore/rendering/RenderListMarker.cpp	2019-04-08 12:38:56 UTC (rev 244005)
@@ -1144,8 +1144,14 @@
 {
     RenderBox::styleDidChange(diff, oldStyle);
 
-    if (oldStyle && (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType()))
-        setNeedsLayoutAndPrefWidthsRecalc();
+    if (oldStyle) {
+        if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType())
+            setNeedsLayoutAndPrefWidthsRecalc();
+        if (oldStyle->isDisplayInlineType() && !style().isDisplayInlineType()) {
+            delete m_inlineBoxWrapper;
+            m_inlineBoxWrapper = nullptr;
+        }
+    }
 
     if (m_image != style().listStyleImage()) {
         if (m_image)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to