Title: [242943] trunk
Revision
242943
Author
[email protected]
Date
2019-03-14 09:21:34 -0700 (Thu, 14 Mar 2019)

Log Message

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: trunk/LayoutTests/ChangeLog (242942 => 242943)


--- trunk/LayoutTests/ChangeLog	2019-03-14 16:05:39 UTC (rev 242942)
+++ trunk/LayoutTests/ChangeLog	2019-03-14 16:21:34 UTC (rev 242943)
@@ -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-14  Ryan Haddad  <[email protected]>
 
         Unreviewed test gardening, rebaseline tests after r241934.

Added: trunk/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt (0 => 242943)


--- trunk/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/list-marker-is-float-crash-expected.txt	2019-03-14 16:21:34 UTC (rev 242943)
@@ -0,0 +1,2 @@
+PASS if no crash.
+

Added: trunk/LayoutTests/fast/block/float/list-marker-is-float-crash.html (0 => 242943)


--- trunk/LayoutTests/fast/block/float/list-marker-is-float-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/block/float/list-marker-is-float-crash.html	2019-03-14 16:21:34 UTC (rev 242943)
@@ -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: trunk/Source/WebCore/ChangeLog (242942 => 242943)


--- trunk/Source/WebCore/ChangeLog	2019-03-14 16:05:39 UTC (rev 242942)
+++ trunk/Source/WebCore/ChangeLog	2019-03-14 16:21:34 UTC (rev 242943)
@@ -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-14  Devin Rousso  <[email protected]>
 
         Web Inspector: Audit: provide a way to get the contents of resources

Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (242942 => 242943)


--- trunk/Source/WebCore/rendering/RenderListMarker.cpp	2019-03-14 16:05:39 UTC (rev 242942)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp	2019-03-14 16:21:34 UTC (rev 242943)
@@ -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