Don't put out-of-flow boxes in anonymous flex/grid items
authorobrufau@igalia.com <obrufau@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 May 2020 16:45:36 +0000 (16:45 +0000)
committerobrufau@igalia.com <obrufau@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 May 2020 16:45:36 +0000 (16:45 +0000)
https://bugs.webkit.org/show_bug.cgi?id=205386

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

A single anonymous flex/grid item should just contain a contiguous
sequence of text runs.

This patch is based on https://crrev.com/533825 from Chromium.

Tests: imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html
       imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html

* rendering/updating/RenderTreeBuilderBlock.cpp:
(WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):

LayoutTests:

Expect tests to pass.

* TestExpectations:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@262061 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/rendering/updating/RenderTreeBuilderBlock.cpp

index 43690cd..c338652 100644 (file)
@@ -1,3 +1,14 @@
+2020-05-22  Oriol Brufau  <obrufau@igalia.com>
+
+        Don't put out-of-flow boxes in anonymous flex/grid items
+        https://bugs.webkit.org/show_bug.cgi?id=205386
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Expect tests to pass.
+
+        * TestExpectations:
+
 2020-05-22  Myles C. Maxfield  <mmaxfield@apple.com>
 
         [Cocoa] fast/text/font-collection.html is failing
index 1009359..2e1032a 100644 (file)
@@ -1059,7 +1059,6 @@ imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-d
 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html [ Pass Failure ]
 imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html [ Pass Failure ]
 webkit.org/b/191367 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html [ ImageOnlyFailure ]
-webkit.org/b/191460 imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html [ Skip ]
 webkit.org/b/191461 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001.html [ ImageOnlyFailure ]
 webkit.org/b/191462 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-replaced-subitems-001.html [ ImageOnlyFailure ]
 webkit.org/b/191463 imported/w3c/web-platform-tests/css/css-grid/grid-items/explicitly-sized-grid-item-as-table.html [ ImageOnlyFailure ]
@@ -4239,7 +4238,6 @@ webkit.org/b/210089 imported/w3c/web-platform-tests/css/css-flexbox/flex-minimum
 webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html [ ImageOnlyFailure ]
 webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html [ ImageOnlyFailure ]
 webkit.org/b/210102 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-auto-min-width.html [ ImageOnlyFailure ]
-webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html [ ImageOnlyFailure ]
 webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-005.html [ ImageOnlyFailure ]
 webkit.org/b/210465 imported/w3c/web-platform-tests/css/css-flexbox/flex-wrap-002.html [ ImageOnlyFailure ]
 webkit.org/b/210475 imported/w3c/web-platform-tests/css/css-flexbox/image-items-flake-001.html [ ImageOnlyFailure ]
index dfd3ebf..ed587d9 100644 (file)
@@ -1,3 +1,21 @@
+2020-05-22  Oriol Brufau  <obrufau@igalia.com>
+
+        Don't put out-of-flow boxes in anonymous flex/grid items
+        https://bugs.webkit.org/show_bug.cgi?id=205386
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        A single anonymous flex/grid item should just contain a contiguous
+        sequence of text runs.
+
+        This patch is based on https://crrev.com/533825 from Chromium.
+
+        Tests: imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html
+               imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html
+
+        * rendering/updating/RenderTreeBuilderBlock.cpp:
+        (WebCore::RenderTreeBuilder::Block::attachIgnoringContinuation):
+
 2020-05-22  Tim Horton  <timothy_horton@apple.com>
 
         iOS: Pressing tab in the Mail subject field moves focus to the body, but pressing shift tab doesn't move it back
index 2e2c82a..103c275 100644 (file)
@@ -222,7 +222,7 @@ void RenderTreeBuilder::Block::attachIgnoringContinuation(RenderBlock& parent, R
             ASSERT(beforeChild->isAnonymousBlock());
             ASSERT(beforeChild->parent() == &parent);
         }
-    } else if (!parent.childrenInline() && (child->isFloatingOrOutOfFlowPositioned() || child->isInline())) {
+    } else if (!parent.childrenInline() && ((child->isFloatingOrOutOfFlowPositioned() && !parent.isFlexibleBox() && !parent.isRenderGrid()) || child->isInline())) {
         // If we're inserting an inline child but all of our children are blocks, then we have to make sure
         // it is put into an anomyous block box. We try to use an existing anonymous box if possible, otherwise
         // a new one is created and inserted into our list of children in the appropriate position.