Title: [260055] trunk
Revision
260055
Author
[email protected]
Date
2020-04-13 19:40:03 -0700 (Mon, 13 Apr 2020)

Log Message

Do not cache definite height against perpendicular flex items.
https://bugs.webkit.org/show_bug.cgi?id=207603
<rdar://problem/59135373>

Reviewed by Simon Fraser.

Source/WebCore:

RenderFlexibleBox::m_hasDefiniteHeight should not be set when the child we check against is a perpendicular item
because a perpendicular box's height is resolved against the containing block's width.

Test: fast/flexbox/unresolved-height-percentage-crash.html

* rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):

LayoutTests:

* fast/flexbox/unresolved-height-percentage-crash-expected.txt: Added.
* fast/flexbox/unresolved-height-percentage-crash.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (260054 => 260055)


--- trunk/LayoutTests/ChangeLog	2020-04-14 01:40:46 UTC (rev 260054)
+++ trunk/LayoutTests/ChangeLog	2020-04-14 02:40:03 UTC (rev 260055)
@@ -1,3 +1,14 @@
+2020-04-13  Zalan Bujtas  <[email protected]>
+
+        Do not cache definite height against perpendicular flex items.
+        https://bugs.webkit.org/show_bug.cgi?id=207603
+        <rdar://problem/59135373>
+
+        Reviewed by Simon Fraser.
+
+        * fast/flexbox/unresolved-height-percentage-crash-expected.txt: Added.
+        * fast/flexbox/unresolved-height-percentage-crash.html: Added.
+
 2020-04-13  Diego Pino Garcia  <[email protected]>
 
         [GTK][WPE] Gardening, update expectations after r260016

Added: trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash-expected.txt (0 => 260055)


--- trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash-expected.txt	2020-04-14 02:40:03 UTC (rev 260055)
@@ -0,0 +1,3 @@
+Pass if no crash or assert.
+
+

Added: trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash.html (0 => 260055)


--- trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash.html	                        (rev 0)
+++ trunk/LayoutTests/fast/flexbox/unresolved-height-percentage-crash.html	2020-04-14 02:40:03 UTC (rev 260055)
@@ -0,0 +1,18 @@
+<style>
+.flexBox {
+    display: -webkit-flex;
+    width: min-content;
+    writing-mode: vertical-lr;
+    -webkit-flex-direction: column-reverse;    
+}
+.flexItem {
+    flex: 0 0 50%;
+    text-anchor: middle; 
+}
+</style>
+Pass if no crash or assert.
+<div class=flexBox><input class=flexItem><div class=flexItem></div></div>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>

Modified: trunk/Source/WebCore/ChangeLog (260054 => 260055)


--- trunk/Source/WebCore/ChangeLog	2020-04-14 01:40:46 UTC (rev 260054)
+++ trunk/Source/WebCore/ChangeLog	2020-04-14 02:40:03 UTC (rev 260055)
@@ -1,3 +1,19 @@
+2020-04-13  Zalan Bujtas  <[email protected]>
+
+        Do not cache definite height against perpendicular flex items.
+        https://bugs.webkit.org/show_bug.cgi?id=207603
+        <rdar://problem/59135373>
+
+        Reviewed by Simon Fraser.
+
+        RenderFlexibleBox::m_hasDefiniteHeight should not be set when the child we check against is a perpendicular item
+        because a perpendicular box's height is resolved against the containing block's width.
+
+        Test: fast/flexbox/unresolved-height-percentage-crash.html
+
+        * rendering/RenderFlexibleBox.cpp:
+        (WebCore::RenderFlexibleBox::computeInnerFlexBaseSizeForChild):
+
 2020-04-13  David Kilzer  <[email protected]>
 
         Replace use of Checked<size_t, RecordOverflow> with CheckedSize

Modified: trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp (260054 => 260055)


--- trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2020-04-14 01:40:46 UTC (rev 260054)
+++ trunk/Source/WebCore/rendering/RenderFlexibleBox.cpp	2020-04-14 02:40:03 UTC (rev 260055)
@@ -767,6 +767,10 @@
             return true;
         if (m_hasDefiniteHeight == SizeDefiniteness::Indefinite)
             return false;
+        // Do not cache the definite height state when the child is perpendicular.
+        // The height of a perpendicular child is resolved against the containing block's width which is not the main axis.
+        if (child.isHorizontalWritingMode() != isHorizontalWritingMode())
+            return false;
         bool definite = child.computePercentageLogicalHeight(flexBasis) != WTF::nullopt;
         if (m_inLayout) {
             // We can reach this code even while we're not laying ourselves out, such
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to