Title: [240111] trunk
Revision
240111
Author
[email protected]
Date
2019-01-17 08:24:14 -0800 (Thu, 17 Jan 2019)

Log Message

[LFC][BFC] An element with transform is a containing block for positioned descendants.
https://bugs.webkit.org/show_bug.cgi?id=193534

Reviewed by Antti Koivisto.

Source/WebCore:

"For elements whose layout is governed by the CSS box model, any value other than none for the transform
property also causes the element to establish a containing block for all descendants."
https://www.w3.org/TR/css-transforms-1/

* layout/layouttree/LayoutBox.cpp:
(WebCore::Layout::Box::containingBlock const):

Tools:

* LayoutReloaded/misc/LFC-passing-tests.txt:

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (240110 => 240111)


--- trunk/Source/WebCore/ChangeLog	2019-01-17 16:07:24 UTC (rev 240110)
+++ trunk/Source/WebCore/ChangeLog	2019-01-17 16:24:14 UTC (rev 240111)
@@ -1,3 +1,17 @@
+2019-01-17  Zalan Bujtas  <[email protected]>
+
+        [LFC][BFC] An element with transform is a containing block for positioned descendants.
+        https://bugs.webkit.org/show_bug.cgi?id=193534
+
+        Reviewed by Antti Koivisto.
+
+        "For elements whose layout is governed by the CSS box model, any value other than none for the transform
+        property also causes the element to establish a containing block for all descendants."
+        https://www.w3.org/TR/css-transforms-1/
+
+        * layout/layouttree/LayoutBox.cpp:
+        (WebCore::Layout::Box::containingBlock const):
+
 2019-01-17  Simon Fraser  <[email protected]>
 
         ScrollingCoordinator: separate updating node geometry from node layers

Modified: trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp (240110 => 240111)


--- trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2019-01-17 16:07:24 UTC (rev 240110)
+++ trunk/Source/WebCore/layout/layouttree/LayoutBox.cpp	2019-01-17 16:24:14 UTC (rev 240111)
@@ -140,15 +140,15 @@
     }
 
     if (isFixedPositioned()) {
-        auto* initialContainingBlock = parent();
-        for (; initialContainingBlock->parent(); initialContainingBlock = initialContainingBlock->parent()) { }
-        return initialContainingBlock;
+        auto* ancestor = parent();
+        for (; ancestor->parent() && !ancestor->style().hasTransform(); ancestor = ancestor->parent()) { }
+        return ancestor;
     }
 
     if (isOutOfFlowPositioned()) {
-        auto* positionedAncestor = parent();
-        for (; positionedAncestor->parent() && !positionedAncestor->isPositioned(); positionedAncestor = positionedAncestor->parent()) { }
-        return positionedAncestor;
+        auto* ancestor = parent();
+        for (; ancestor->parent() && !ancestor->isPositioned() && !ancestor->style().hasTransform(); ancestor = ancestor->parent()) { }
+        return ancestor;
     }
 
     ASSERT_NOT_REACHED();

Modified: trunk/Tools/ChangeLog (240110 => 240111)


--- trunk/Tools/ChangeLog	2019-01-17 16:07:24 UTC (rev 240110)
+++ trunk/Tools/ChangeLog	2019-01-17 16:24:14 UTC (rev 240111)
@@ -1,5 +1,14 @@
 2019-01-17  Zalan Bujtas  <[email protected]>
 
+        [LFC][BFC] An element with transform is a containing block for positioned descendants.
+        https://bugs.webkit.org/show_bug.cgi?id=193534
+
+        Reviewed by Antti Koivisto.
+
+        * LayoutReloaded/misc/LFC-passing-tests.txt:
+
+2019-01-17  Zalan Bujtas  <[email protected]>
+
         [LFC][BFC][Quirk] Take body padding and border into account when stretching height.
         https://bugs.webkit.org/show_bug.cgi?id=193528
 

Modified: trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt (240110 => 240111)


--- trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-17 16:07:24 UTC (rev 240110)
+++ trunk/Tools/LayoutReloaded/misc/LFC-passing-tests.txt	2019-01-17 16:24:14 UTC (rev 240111)
@@ -191,6 +191,7 @@
 fast/block/crash-when-anonymous-blocks-are-merged-with-simple-line-layout.html
 fast/block/crash-when-subtree-is-still-attached.html
 fast/block/geometry-map-assertion-with-tall-content.html
+fast/block/containing-block-changes.html
 fast/borders/0px-borders-no-line-height.html
 fast/borders/0px-borders.html
 fast/borders/block-mask-overlay-image-outset.html
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to