Title: [290059] branches/safari-613.1.17.1-branch
Revision
290059
Author
alanc...@apple.com
Date
2022-02-17 13:01:05 -0800 (Thu, 17 Feb 2022)

Log Message

Cherry-pick r289995. rdar://problem/87462825

    REGRESSION(r285885) Unable to exit Trip Details in Amtrak app
    https://bugs.webkit.org/show_bug.cgi?id=236732
    <rdar://87462825>

    Reviewed by Simon Fraser.

    Source/WebCore:

    Starting from r285885 an (effective)”overflow: clip” value is set on any block box with “contain: paint”.
    It is supposed to ensure we don’t paint outside of the box’s border box (note that "contain: paint", as the name implies, should only affect painting).

    However this effective value trickles in to layout affecting certain layout constraints.
    In case of flex, it makes the flex layout think that the box is really a clipped box and it starts flexing it accordingly producing incorrect size.
    What it means is that the minimum preferred size ends up being 0px because now with "let's clip all the overflow content"
    0px is indeed the smallest size a box could take that does not produce overflow (while with the initial, “overflow: visible” value,
    its minimum width would likely be > 0px -provided it has some content. Also note that setting “overflow: clip” on the box in the markup
    (so it becomes an explicit clip value and not just an “effective” implicit clip through “contain: paint”) produces
    the exact same rendering meaning that this effective property value does affect layout).

    This is a partial revert of r285885 (focusing on where the flex algorithm consults with the flex items' overflow values).

    Test: fast/flexbox/incorrect-min-size-with-paint-contain.html

    * rendering/RenderFlexibleBox.cpp:
    (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
    (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):

    LayoutTests:

    * fast/flexbox/incorrect-min-size-with-paint-contain-expected.html: Added.
    * fast/flexbox/incorrect-min-size-with-paint-contain.html: Added.

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

Modified Paths

Added Paths

Diff

Modified: branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog (290058 => 290059)


--- branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog	2022-02-17 21:01:02 UTC (rev 290058)
+++ branches/safari-613.1.17.1-branch/LayoutTests/ChangeLog	2022-02-17 21:01:05 UTC (rev 290059)
@@ -1,3 +1,53 @@
+2022-02-17  Russell Epstein  <repst...@apple.com>
+
+        Cherry-pick r289995. rdar://problem/87462825
+
+    REGRESSION(r285885) Unable to exit Trip Details in Amtrak app
+    https://bugs.webkit.org/show_bug.cgi?id=236732
+    <rdar://87462825>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    Starting from r285885 an (effective)”overflow: clip” value is set on any block box with “contain: paint”.
+    It is supposed to ensure we don’t paint outside of the box’s border box (note that "contain: paint", as the name implies, should only affect painting).
+    
+    However this effective value trickles in to layout affecting certain layout constraints.
+    In case of flex, it makes the flex layout think that the box is really a clipped box and it starts flexing it accordingly producing incorrect size.
+    What it means is that the minimum preferred size ends up being 0px because now with "let's clip all the overflow content"
+    0px is indeed the smallest size a box could take that does not produce overflow (while with the initial, “overflow: visible” value,
+    its minimum width would likely be > 0px -provided it has some content. Also note that setting “overflow: clip” on the box in the markup
+    (so it becomes an explicit clip value and not just an “effective” implicit clip through “contain: paint”) produces
+    the exact same rendering meaning that this effective property value does affect layout).
+    
+    This is a partial revert of r285885 (focusing on where the flex algorithm consults with the flex items' overflow values).
+    
+    Test: fast/flexbox/incorrect-min-size-with-paint-contain.html
+    
+    * rendering/RenderFlexibleBox.cpp:
+    (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
+    (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):
+    
+    LayoutTests:
+    
+    * fast/flexbox/incorrect-min-size-with-paint-contain-expected.html: Added.
+    * fast/flexbox/incorrect-min-size-with-paint-contain.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-16  Alan Bujtas  <za...@apple.com>
+
+            REGRESSION(r285885) Unable to exit Trip Details in Amtrak app
+            https://bugs.webkit.org/show_bug.cgi?id=236732
+            <rdar://87462825>
+
+            Reviewed by Simon Fraser.
+
+            * fast/flexbox/incorrect-min-size-with-paint-contain-expected.html: Added.
+            * fast/flexbox/incorrect-min-size-with-paint-contain.html: Added.
+
 2022-02-16  Russell Epstein  <repst...@apple.com>
 
         Cherry-pick r289892. rdar://problem/88696673

Added: branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain-expected.html (0 => 290059)


--- branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain-expected.html	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain-expected.html	2022-02-17 21:01:05 UTC (rev 290059)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<style>
+div {
+  height: 100px;
+  width: 100px;
+  background-color: green;
+}
+</style>
+<div></div>
\ No newline at end of file

Added: branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain.html (0 => 290059)


--- branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain.html	                        (rev 0)
+++ branches/safari-613.1.17.1-branch/LayoutTests/fast/flexbox/incorrect-min-size-with-paint-contain.html	2022-02-17 21:01:05 UTC (rev 290059)
@@ -0,0 +1,18 @@
+<!DOCTYPE html>
+<style>
+div {
+  height: 100px;
+  width: 100px;
+}
+.container {
+  display: flex;
+}
+.paintcontain {
+  contain: paint;
+}
+</style>
+<!-- PASS if the green box is visible -->
+<div class=container>
+  <div class=paintcontain><div style="background-color: green;"></div></div>
+  <div><div></div></div>
+</div>
\ No newline at end of file

Modified: branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog (290058 => 290059)


--- branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog	2022-02-17 21:01:02 UTC (rev 290058)
+++ branches/safari-613.1.17.1-branch/Source/WebCore/ChangeLog	2022-02-17 21:01:05 UTC (rev 290059)
@@ -1,5 +1,71 @@
 2022-02-17  Russell Epstein  <repst...@apple.com>
 
+        Cherry-pick r289995. rdar://problem/87462825
+
+    REGRESSION(r285885) Unable to exit Trip Details in Amtrak app
+    https://bugs.webkit.org/show_bug.cgi?id=236732
+    <rdar://87462825>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    Starting from r285885 an (effective)”overflow: clip” value is set on any block box with “contain: paint”.
+    It is supposed to ensure we don’t paint outside of the box’s border box (note that "contain: paint", as the name implies, should only affect painting).
+    
+    However this effective value trickles in to layout affecting certain layout constraints.
+    In case of flex, it makes the flex layout think that the box is really a clipped box and it starts flexing it accordingly producing incorrect size.
+    What it means is that the minimum preferred size ends up being 0px because now with "let's clip all the overflow content"
+    0px is indeed the smallest size a box could take that does not produce overflow (while with the initial, “overflow: visible” value,
+    its minimum width would likely be > 0px -provided it has some content. Also note that setting “overflow: clip” on the box in the markup
+    (so it becomes an explicit clip value and not just an “effective” implicit clip through “contain: paint”) produces
+    the exact same rendering meaning that this effective property value does affect layout).
+    
+    This is a partial revert of r285885 (focusing on where the flex algorithm consults with the flex items' overflow values).
+    
+    Test: fast/flexbox/incorrect-min-size-with-paint-contain.html
+    
+    * rendering/RenderFlexibleBox.cpp:
+    (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
+    (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):
+    
+    LayoutTests:
+    
+    * fast/flexbox/incorrect-min-size-with-paint-contain-expected.html: Added.
+    * fast/flexbox/incorrect-min-size-with-paint-contain.html: Added.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@289995 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2022-02-16  Alan Bujtas  <za...@apple.com>
+
+            REGRESSION(r285885) Unable to exit Trip Details in Amtrak app
+            https://bugs.webkit.org/show_bug.cgi?id=236732
+            <rdar://87462825>
+
+            Reviewed by Simon Fraser.
+
+            Starting from r285885 an (effective)”overflow: clip” value is set on any block box with “contain: paint”.
+            It is supposed to ensure we don’t paint outside of the box’s border box (note that "contain: paint", as the name implies, should only affect painting).
+
+            However this effective value trickles in to layout affecting certain layout constraints.
+            In case of flex, it makes the flex layout think that the box is really a clipped box and it starts flexing it accordingly producing incorrect size.
+            What it means is that the minimum preferred size ends up being 0px because now with "let's clip all the overflow content"
+            0px is indeed the smallest size a box could take that does not produce overflow (while with the initial, “overflow: visible” value,
+            its minimum width would likely be > 0px -provided it has some content. Also note that setting “overflow: clip” on the box in the markup
+            (so it becomes an explicit clip value and not just an “effective” implicit clip through “contain: paint”) produces
+            the exact same rendering meaning that this effective property value does affect layout).
+
+            This is a partial revert of r285885 (focusing on where the flex algorithm consults with the flex items' overflow values).
+
+            Test: fast/flexbox/incorrect-min-size-with-paint-contain.html
+
+            * rendering/RenderFlexibleBox.cpp:
+            (WebCore::RenderFlexibleBox::mainAxisOverflowForChild const):
+            (WebCore::RenderFlexibleBox::crossAxisOverflowForChild const):
+
+2022-02-17  Russell Epstein  <repst...@apple.com>
+
         Cherry-pick r289942. rdar://problem/88827167
 
     [Cocoa] Update audio session category before setting NowPlaying status

Modified: branches/safari-613.1.17.1-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp (290058 => 290059)


--- branches/safari-613.1.17.1-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp	2022-02-17 21:01:02 UTC (rev 290058)
+++ branches/safari-613.1.17.1-branch/Source/WebCore/rendering/RenderFlexibleBox.cpp	2022-02-17 21:01:05 UTC (rev 290059)
@@ -1895,15 +1895,15 @@
 Overflow RenderFlexibleBox::mainAxisOverflowForChild(const RenderBox& child) const
 {
     if (isHorizontalFlow())
-        return child.effectiveOverflowX();
-    return child.effectiveOverflowY();
+        return child.style().overflowX();
+    return child.style().overflowY();
 }
 
 Overflow RenderFlexibleBox::crossAxisOverflowForChild(const RenderBox& child) const
 {
     if (isHorizontalFlow())
-        return child.effectiveOverflowY();
-    return child.effectiveOverflowX();
+        return child.style().overflowY();
+    return child.style().overflowX();
 }
 
 bool RenderFlexibleBox::childHasPercentHeightDescendants(const RenderBox& renderer) const
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to