Title: [264328] trunk
Revision
264328
Author
[email protected]
Date
2020-07-13 19:53:45 -0700 (Mon, 13 Jul 2020)

Log Message

[RenderTreeNeedsLayoutChecker] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html asserts
https://bugs.webkit.org/show_bug.cgi?id=214281
<rdar://problem/56740133>

Reviewed by Simon Fraser.

Source/WebCore:

While percentage height descendant computation runs on the containing block chain, when
we mark the ancestors for layout, we need to traverse the parent (container) chain rather than the containing block chain.
Containing block traversal skips certain non-block renderers which leaves gap between dirty renderers.

Renderer[A] + dirty
  Renderer[B] - not dirty
    Renderer[C] + dirty

During layout this gap (Renderer[B]) makes us exit early, resulting dirty leftover renderers (Renderer[C]).

This is similar to what we do in RenderObject::markContainingBlocksForLayout.

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

LayoutTests:

* TestExpectations:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (264327 => 264328)


--- trunk/LayoutTests/ChangeLog	2020-07-14 00:59:05 UTC (rev 264327)
+++ trunk/LayoutTests/ChangeLog	2020-07-14 02:53:45 UTC (rev 264328)
@@ -1,3 +1,13 @@
+2020-07-13  Zalan Bujtas  <[email protected]>
+
+        [RenderTreeNeedsLayoutChecker] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html asserts
+        https://bugs.webkit.org/show_bug.cgi?id=214281
+        <rdar://problem/56740133>
+
+        Reviewed by Simon Fraser.
+
+        * TestExpectations:
+
 2020-07-13  Truitt Savell  <[email protected]>
 
         (r264202) [ Mac WK2 ] imported/w3c/web-platform-tests/webrtc/RTCPeerConnection-connectionState.https.html

Modified: trunk/LayoutTests/TestExpectations (264327 => 264328)


--- trunk/LayoutTests/TestExpectations	2020-07-14 00:59:05 UTC (rev 264327)
+++ trunk/LayoutTests/TestExpectations	2020-07-14 02:53:45 UTC (rev 264328)
@@ -509,7 +509,6 @@
 imported/w3c/web-platform-tests/html/cross-origin-opener-policy [ Skip ]
 
 # Newly imported WPT tests that are crashing.
-[ Debug ] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html [ Crash ]
 [ Debug ] imported/w3c/web-platform-tests/custom-elements/upgrading.html [ Crash ]
 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-embed-element/embed-represent-nothing-04.html [ ImageOnlyFailure Crash ]
 

Modified: trunk/Source/WebCore/ChangeLog (264327 => 264328)


--- trunk/Source/WebCore/ChangeLog	2020-07-14 00:59:05 UTC (rev 264327)
+++ trunk/Source/WebCore/ChangeLog	2020-07-14 02:53:45 UTC (rev 264328)
@@ -1,3 +1,26 @@
+2020-07-13  Zalan Bujtas  <[email protected]>
+
+        [RenderTreeNeedsLayoutChecker] imported/w3c/web-platform-tests/html/rendering/replaced-elements/embedded-content/video-controls-vertical-writing-mode.html asserts
+        https://bugs.webkit.org/show_bug.cgi?id=214281
+        <rdar://problem/56740133>
+
+        Reviewed by Simon Fraser.
+
+        While percentage height descendant computation runs on the containing block chain, when
+        we mark the ancestors for layout, we need to traverse the parent (container) chain rather than the containing block chain.
+        Containing block traversal skips certain non-block renderers which leaves gap between dirty renderers.
+
+        Renderer[A] + dirty
+          Renderer[B] - not dirty
+            Renderer[C] + dirty
+
+        During layout this gap (Renderer[B]) makes us exit early, resulting dirty leftover renderers (Renderer[C]).
+
+        This is similar to what we do in RenderObject::markContainingBlocksForLayout.
+
+        * rendering/RenderBlock.cpp:
+        (WebCore::RenderBlock::dirtyForLayoutFromPercentageHeightDescendants):
+
 2020-07-13  Andres Gonzalez  <[email protected]>
 
         REGRESSION: (r257915?) [ Mac ] accessibility/accessibility-node-memory-management.html is flaky failing.

Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (264327 => 264328)


--- trunk/Source/WebCore/rendering/RenderBlock.cpp	2020-07-14 00:59:05 UTC (rev 264327)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp	2020-07-14 02:53:45 UTC (rev 264328)
@@ -817,10 +817,10 @@
         return;
 
     for (auto it = descendants->begin(), end = descendants->end(); it != end; ++it) {
-        auto* box = *it;
+        RenderElement* renderer = *it;
         // Let's not dirty the height perecentage descendant when it has an absolutely positioned containing block ancestor. We should be able to dirty such boxes through the regular invalidation logic.
         bool descendantNeedsLayout = true;
-        for (auto* ancestor = box->containingBlock(); ancestor && ancestor != this; ancestor = ancestor->containingBlock()) {
+        for (auto* ancestor = renderer->containingBlock(); ancestor && ancestor != this; ancestor = ancestor->containingBlock()) {
             if (ancestor->isOutOfFlowPositioned()) {
                 descendantNeedsLayout = false;
                 break;
@@ -829,22 +829,22 @@
         if (!descendantNeedsLayout)
             continue;
 
-        while (box != this) {
-            if (box->normalChildNeedsLayout())
+        while (renderer != this) {
+            if (renderer->normalChildNeedsLayout())
                 break;
-            box->setChildNeedsLayout(MarkOnlyThis);
+            renderer->setChildNeedsLayout(MarkOnlyThis);
             
             // If the width of an image is affected by the height of a child (e.g., an image with an aspect ratio),
             // then we have to dirty preferred widths, since even enclosing blocks can become dirty as a result.
             // (A horizontal flexbox that contains an inline image wrapped in an anonymous block for example.)
-            if (box->hasAspectRatio()) 
-                box->setPreferredLogicalWidthsDirty(true);
-            auto* containingBlock = box->containingBlock();
-            // Mark the svg ancestor chain dirty as we walk to the containing block. containingBlock() just skips them. See webkit.org/b/183874.
-            if (is<SVGElement>(box->element()) && containingBlock != box->parent()) {
-                auto* ancestor = box->parent();
-                ASSERT(ancestor->isDescendantOf(containingBlock));
-                while (ancestor != containingBlock) {
+            if (renderer->hasAspectRatio())
+                renderer->setPreferredLogicalWidthsDirty(true);
+            auto* container = renderer->container();
+            // Mark the svg ancestor chain dirty as we walk to the container.
+            if (is<SVGElement>(renderer->element()) && container != renderer->parent()) {
+                auto* ancestor = renderer->parent();
+                ASSERT(ancestor->isDescendantOf(container));
+                while (ancestor != container) {
                     ancestor->setChildNeedsLayout(MarkOnlyThis);
                     // This is the topmost SVG root, no need to go any further.
                     if (is<SVGSVGElement>(ancestor->element()) && !downcast<SVGSVGElement>(*ancestor->element()).ownerSVGElement())
@@ -852,9 +852,9 @@
                     ancestor = ancestor->parent();
                 }
             }
-            box = containingBlock;
-            ASSERT(box);
-            if (!box)
+            renderer = container;
+            ASSERT(renderer);
+            if (!renderer)
                 break;
         }
     }
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to