Title: [262540] trunk/Source/WebCore
Revision
262540
Author
[email protected]
Date
2020-06-04 08:49:50 -0700 (Thu, 04 Jun 2020)

Log Message

Reset fragment line info when the relatively positioned inline box becomes static with block child.
https://bugs.webkit.org/show_bug.cgi?id=212724
<rdar://problem/62847534>

Reviewed by Simon Fraser.

adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded was missing the case when the
block container was inside an inline box. It happens when the inline box is relatively positioned while the
child block box is absolutely positioned.
RenderFragmentedFlow keeps track of the associated root lineboxes in m_lineToFragmentMap.
In adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded, when the block is no longer part of the fragment
we remove these cached lineboxes from the m_lineToFragmentMap.
This patch fixes the case when the cached lineboxes are generated by a child block box.

* rendering/RenderElement.cpp:
(WebCore::RenderElement::adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (262539 => 262540)


--- trunk/Source/WebCore/ChangeLog	2020-06-04 15:07:11 UTC (rev 262539)
+++ trunk/Source/WebCore/ChangeLog	2020-06-04 15:49:50 UTC (rev 262540)
@@ -1,3 +1,22 @@
+2020-06-04  Zalan Bujtas  <[email protected]>
+
+        Reset fragment line info when the relatively positioned inline box becomes static with block child.
+        https://bugs.webkit.org/show_bug.cgi?id=212724
+        <rdar://problem/62847534>
+
+        Reviewed by Simon Fraser.
+
+        adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded was missing the case when the
+        block container was inside an inline box. It happens when the inline box is relatively positioned while the
+        child block box is absolutely positioned.
+        RenderFragmentedFlow keeps track of the associated root lineboxes in m_lineToFragmentMap.
+        In adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded, when the block is no longer part of the fragment
+        we remove these cached lineboxes from the m_lineToFragmentMap.
+        This patch fixes the case when the cached lineboxes are generated by a child block box.
+
+        * rendering/RenderElement.cpp:
+        (WebCore::RenderElement::adjustFragmentedFlowStateOnContainingBlockChangeIfNeeded):
+
 2020-06-04  Youenn Fablet  <[email protected]>
 
         Read MediaPlayerPrivateMediaStreamAVFObjC::m_canEnqueueDisplayLayer after the lock

Modified: trunk/Source/WebCore/rendering/RenderElement.cpp (262539 => 262540)


--- trunk/Source/WebCore/rendering/RenderElement.cpp	2020-06-04 15:07:11 UTC (rev 262539)
+++ trunk/Source/WebCore/rendering/RenderElement.cpp	2020-06-04 15:49:50 UTC (rev 262540)
@@ -2089,6 +2089,11 @@
     // Invalidate the containing block caches.
     if (is<RenderBlock>(*this))
         downcast<RenderBlock>(*this).resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants();
+    else {
+        // Relatively positioned inline boxes can have absolutely positioned block children. We need to reset them as well.
+        for (auto& descendant : childrenOfType<RenderBlock>(*this))
+            descendant.resetEnclosingFragmentedFlowAndChildInfoIncludingDescendants();
+    }
     
     // Adjust the flow tread state on the subtree.
     setFragmentedFlowState(RenderObject::computedFragmentedFlowState(*this));
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to