Title: [280130] trunk/Source/WebCore
Revision
280130
Author
[email protected]
Date
2021-07-21 06:40:16 -0700 (Wed, 21 Jul 2021)

Log Message

Missing layouts when using simplified layout with OOF positioned elements
https://bugs.webkit.org/show_bug.cgi?id=226008

Reviewed by Alan Bujtas.

There are some situations that allow us to do simplified layouts like when there is a positioned child
that needs to be laid out and neither the parent nor any other normal children needs it. In those cases
we just pick the list of positioned objects and invoke layoutPositionedObjects(). However that list
might not be properly updated since it's only done during the layout in RenderBlock::layoutBlockChildren().

This is causing that we miss layouts in cases where a renderer has the posChildNeedsLayout() bit set
(due to some style change for example) but no descendants in the positionedDescendantsMap() because
it has not been laid out yet. In those cases we simply bail out the simplified layout and proceed as in
the normal layout process.

* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::simplifiedLayout):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (280129 => 280130)


--- trunk/Source/WebCore/ChangeLog	2021-07-21 12:57:20 UTC (rev 280129)
+++ trunk/Source/WebCore/ChangeLog	2021-07-21 13:40:16 UTC (rev 280130)
@@ -1,3 +1,23 @@
+2021-07-01  Sergio Villar Senin  <[email protected]>
+
+        Missing layouts when using simplified layout with OOF positioned elements
+        https://bugs.webkit.org/show_bug.cgi?id=226008
+
+        Reviewed by Alan Bujtas.
+
+        There are some situations that allow us to do simplified layouts like when there is a positioned child
+        that needs to be laid out and neither the parent nor any other normal children needs it. In those cases
+        we just pick the list of positioned objects and invoke layoutPositionedObjects(). However that list
+        might not be properly updated since it's only done during the layout in RenderBlock::layoutBlockChildren().
+
+        This is causing that we miss layouts in cases where a renderer has the posChildNeedsLayout() bit set
+        (due to some style change for example) but no descendants in the positionedDescendantsMap() because
+        it has not been laid out yet. In those cases we simply bail out the simplified layout and proceed as in
+        the normal layout process.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::simplifiedLayout):
+
 2021-07-21  David Kilzer  <[email protected]>
 
         GetIdentifierStringForPreferredVoiceInListWithLocale() is deprecated in Monterey

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (280129 => 280130)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-07-21 12:57:20 UTC (rev 280129)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2021-07-21 13:40:16 UTC (rev 280130)
@@ -940,8 +940,12 @@
     // relative positioned container. So if we can have fixed pos objects in our positioned objects list check if any of them
     // are statically positioned and thus need to move with their absolute ancestors.
     bool canContainFixedPosObjects = canContainFixedPositionObjects();
-    if (posChildNeedsLayout() || canContainFixedPosObjects)
+    if (posChildNeedsLayout() || canContainFixedPosObjects) {
+        // FIXME: Remove this early return once https://webkit.org/b/228125 is fixed.
+        if (!hasPositionedObjects())
+            return false;
         layoutPositionedObjects(false, !posChildNeedsLayout() && canContainFixedPosObjects);
+    }
 
     // Recompute our overflow information.
     // FIXME: We could do better here by computing a temporary overflow object from layoutPositionedObjects and only
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to