Title: [288255] releases/WebKitGTK/webkit-2.34
- Revision
- 288255
- Author
- [email protected]
- Date
- 2022-01-19 17:19:01 -0800 (Wed, 19 Jan 2022)
Log Message
Merge r285232 - Return nullopt in aspect-ratio+intrinsic width case
https://bugs.webkit.org/show_bug.cgi?id=230769
Patch by Rob Buis <[email protected]> on 2021-11-03
Reviewed by Javier Fernandez.
Source/WebCore:
Return nullopt in aspect-ratio+intrinsic width case, while
calculating preferred widths we do not know the container width yet,
so we can't determine the logical height reliably from it.
Test: fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
LayoutTests:
* fast/css-grid-layout/aspect-ratio-auto-repeat-crash-expected.txt: Added.
* fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html: Added.
Modified Paths
Added Paths
Diff
Modified: releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog (288254 => 288255)
--- releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog 2022-01-20 01:06:54 UTC (rev 288254)
+++ releases/WebKitGTK/webkit-2.34/LayoutTests/ChangeLog 2022-01-20 01:19:01 UTC (rev 288255)
@@ -1,3 +1,13 @@
+2021-11-03 Rob Buis <[email protected]>
+
+ Return nullopt in aspect-ratio+intrinsic width case
+ https://bugs.webkit.org/show_bug.cgi?id=230769
+
+ Reviewed by Javier Fernandez.
+
+ * fast/css-grid-layout/aspect-ratio-auto-repeat-crash-expected.txt: Added.
+ * fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html: Added.
+
2021-10-25 Gabriel Nava Marino <[email protected]>
ASSERT(node) triggered after surroundNodeRangeWithElement for node without editable style
Added: releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash-expected.txt (0 => 288255)
--- releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash-expected.txt (rev 0)
+++ releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash-expected.txt 2022-01-20 01:19:01 UTC (rev 288255)
@@ -0,0 +1 @@
+This test has PASSED if it does not CRASH.
Added: releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html (0 => 288255)
--- releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html (rev 0)
+++ releases/WebKitGTK/webkit-2.34/LayoutTests/fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html 2022-01-20 01:19:01 UTC (rev 288255)
@@ -0,0 +1,19 @@
+<style>
+ html {
+ display: table;
+ }
+ head {
+ aspect-ratio: 1;
+ border-block-end: 15px solid;
+ display: grid;
+ grid-gap: 100%;
+ grid-template-rows: 1% repeat(auto-fill, 20px) 0;
+ padding-bottom: 5px;
+ padding-left: 40px;
+ }
+</style>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+This test has PASSED if it does not CRASH.
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog (288254 => 288255)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog 2022-01-20 01:06:54 UTC (rev 288254)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/ChangeLog 2022-01-20 01:19:01 UTC (rev 288255)
@@ -1,3 +1,19 @@
+2021-11-03 Rob Buis <[email protected]>
+
+ Return nullopt in aspect-ratio+intrinsic width case
+ https://bugs.webkit.org/show_bug.cgi?id=230769
+
+ Reviewed by Javier Fernandez.
+
+ Return nullopt in aspect-ratio+intrinsic width case, while
+ calculating preferred widths we do not know the container width yet,
+ so we can't determine the logical height reliably from it.
+
+ Test: fast/css-grid-layout/aspect-ratio-auto-repeat-crash.html
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::availableLogicalHeightForPercentageComputation const):
+
2021-10-25 Gabriel Nava Marino <[email protected]>
ASSERT(node) triggered after surroundNodeRangeWithElement for node without editable style
Modified: releases/WebKitGTK/webkit-2.34/Source/WebCore/rendering/RenderBlock.cpp (288254 => 288255)
--- releases/WebKitGTK/webkit-2.34/Source/WebCore/rendering/RenderBlock.cpp 2022-01-20 01:06:54 UTC (rev 288254)
+++ releases/WebKitGTK/webkit-2.34/Source/WebCore/rendering/RenderBlock.cpp 2022-01-20 01:19:01 UTC (rev 288255)
@@ -3171,6 +3171,9 @@
LayoutUnit contentBoxHeight = adjustContentBoxLogicalHeightForBoxSizing((LayoutUnit)styleToUse.logicalHeight().value());
availableHeight = std::max(0_lu, constrainContentBoxLogicalHeightByMinMax(contentBoxHeight - scrollbarLogicalHeight(), std::nullopt));
} else if (shouldComputeLogicalHeightFromAspectRatio()) {
+ // Only grid is expected to be in a state where it is calculating pref width and having unknown logical width.
+ if (isRenderGrid() && preferredLogicalWidthsDirty() && !style().logicalWidth().isFixed())
+ return availableHeight;
availableHeight = blockSizeFromAspectRatio(horizontalBorderAndPaddingExtent(), verticalBorderAndPaddingExtent(), LayoutUnit(style().logicalAspectRatio()), style().boxSizingForAspectRatio(), logicalWidth());
} else if (isOutOfFlowPositionedWithSpecifiedHeight) {
// Don't allow this to affect the block' size() member variable, since this
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes