Title: [260196] trunk
Revision
260196
Author
[email protected]
Date
2020-04-16 10:39:30 -0700 (Thu, 16 Apr 2020)

Log Message

Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved
https://bugs.webkit.org/show_bug.cgi?id=210584
<rdar://problem/56685237>

Reviewed by Manuel Rego Casasnovas.

Source/WebCore:

Use the initial value of 0 when the min-height can't be resolved.

Test: fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html

* rendering/GridTrackSizingAlgorithm.cpp:
(WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded const):

LayoutTests:

* fast/css-grid-layout/crash-when-min-height-cant-be-resolved-expected.txt: Added.
* fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (260195 => 260196)


--- trunk/LayoutTests/ChangeLog	2020-04-16 17:30:43 UTC (rev 260195)
+++ trunk/LayoutTests/ChangeLog	2020-04-16 17:39:30 UTC (rev 260196)
@@ -1,3 +1,14 @@
+2020-04-16  Zalan Bujtas  <[email protected]>
+
+        Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved
+        https://bugs.webkit.org/show_bug.cgi?id=210584
+        <rdar://problem/56685237>
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        * fast/css-grid-layout/crash-when-min-height-cant-be-resolved-expected.txt: Added.
+        * fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html: Added.
+
 2020-04-16  Daniel Bates  <[email protected]>
 
         Move -_requestTextInputContextsInRect to WKContentView to simplify implementation

Added: trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved-expected.txt (0 => 260196)


--- trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved-expected.txt	2020-04-16 17:39:30 UTC (rev 260196)
@@ -0,0 +1 @@
+Pass if no crash or assert when the min-height value can't be resolved.

Added: trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html (0 => 260196)


--- trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html	                        (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html	2020-04-16 17:39:30 UTC (rev 260196)
@@ -0,0 +1,13 @@
+<style>
+pre {
+    display: grid;
+    min-height: max-content;
+    max-height: 1px;
+    grid-template-rows: 1fr;
+}
+</style>
+<pre>Pass if no crash or assert when the min-height value can't be resolved.</pre>
+<script>
+if (window.testRunner)
+    testRunner.dumpAsText();
+</script>

Modified: trunk/Source/WebCore/ChangeLog (260195 => 260196)


--- trunk/Source/WebCore/ChangeLog	2020-04-16 17:30:43 UTC (rev 260195)
+++ trunk/Source/WebCore/ChangeLog	2020-04-16 17:39:30 UTC (rev 260196)
@@ -1,3 +1,18 @@
+2020-04-16  Zalan Bujtas  <[email protected]>
+
+        Crash in IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded when min-size can not be resolved
+        https://bugs.webkit.org/show_bug.cgi?id=210584
+        <rdar://problem/56685237>
+
+        Reviewed by Manuel Rego Casasnovas.
+
+        Use the initial value of 0 when the min-height can't be resolved.
+
+        Test: fast/css-grid-layout/crash-when-min-height-cant-be-resolved.html
+
+        * rendering/GridTrackSizingAlgorithm.cpp:
+        (WebCore::IndefiniteSizeStrategy::recomputeUsedFlexFractionIfNeeded const):
+
 2020-04-16  Adrian Perez de Castro  <[email protected]>
 
         Non-unified build fixes mid April 2020 edition

Modified: trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp (260195 => 260196)


--- trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2020-04-16 17:30:43 UTC (rev 260195)
+++ trunk/Source/WebCore/rendering/GridTrackSizingAlgorithm.cpp	2020-04-16 17:39:30 UTC (rev 260196)
@@ -1014,7 +1014,7 @@
 
     LayoutUnit freeSpace = checkMaxSize ? maxSize.value() : -1_lu;
     const Grid& grid = m_algorithm.grid();
-    freeSpace = std::max(freeSpace, minSize.value()) - renderGrid->guttersSize(grid, ForRows, 0, grid.numTracks(ForRows), availableSpace());
+    freeSpace = std::max(freeSpace, minSize.valueOr(0_lu)) - renderGrid->guttersSize(grid, ForRows, 0, grid.numTracks(ForRows), availableSpace());
 
     size_t numberOfTracks = m_algorithm.tracks(ForRows).size();
     flexFraction = findFrUnitSize(GridSpan::translatedDefiniteGridSpan(0, numberOfTracks), freeSpace);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to