Title: [274387] trunk/Source/WebCore
Revision
274387
Author
[email protected]
Date
2021-03-13 08:09:52 -0800 (Sat, 13 Mar 2021)

Log Message

Mark the line dirty when list marker goes from inline to block
https://bugs.webkit.org/show_bug.cgi?id=223132

Reviewed by Antti Koivisto.

This patch ensures that the line layout has a chance to clean up the inline boxes when the marker goes from inline to block.
Instead of deleting the inline box wrapper (InlineElement) here let's
1. mark both the renderer and the line dirty and let the inline layout code run its normal cleanup process on dirty lines.
2. detach the inline box wrapper from the now-block list marker.

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

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (274386 => 274387)


--- trunk/Source/WebCore/ChangeLog	2021-03-13 15:06:04 UTC (rev 274386)
+++ trunk/Source/WebCore/ChangeLog	2021-03-13 16:09:52 UTC (rev 274387)
@@ -1,3 +1,20 @@
+2021-03-13  Zalan Bujtas  <[email protected]>
+
+        Mark the line dirty when list marker goes from inline to block
+        https://bugs.webkit.org/show_bug.cgi?id=223132
+
+        Reviewed by Antti Koivisto.
+
+        This patch ensures that the line layout has a chance to clean up the inline boxes when the marker goes from inline to block.
+        Instead of deleting the inline box wrapper (InlineElement) here let's
+        1. mark both the renderer and the line dirty and let the inline layout code run its normal cleanup process on dirty lines.
+        2. detach the inline box wrapper from the now-block list marker.
+
+        * rendering/RenderListMarker.cpp:
+        (WebCore::RenderListMarker::styleDidChange):
+        * rendering/RootInlineBox.cpp:
+        (WebCore::RootInlineBox::verticalPositionForBox):
+
 2021-03-13  Philippe Normand  <[email protected]>
 
         Unreviewed, fix build warnings after r273204 and r274323

Modified: trunk/Source/WebCore/rendering/RenderListMarker.cpp (274386 => 274387)


--- trunk/Source/WebCore/rendering/RenderListMarker.cpp	2021-03-13 15:06:04 UTC (rev 274386)
+++ trunk/Source/WebCore/rendering/RenderListMarker.cpp	2021-03-13 16:09:52 UTC (rev 274387)
@@ -1093,7 +1093,9 @@
         if (style().listStylePosition() != oldStyle->listStylePosition() || style().listStyleType() != oldStyle->listStyleType() || (style().listStyleType() == ListStyleType::String && style().listStyleStringValue() != oldStyle->listStyleStringValue()))
             setNeedsLayoutAndPrefWidthsRecalc();
         if (oldStyle->isDisplayInlineType() && !style().isDisplayInlineType()) {
-            delete m_inlineBoxWrapper;
+            setNeedsLayoutAndPrefWidthsRecalc();
+            if (m_inlineBoxWrapper)
+                m_inlineBoxWrapper->dirtyLineBoxes();
             m_inlineBoxWrapper = nullptr;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to