Title: [266716] trunk
- Revision
- 266716
- Author
- [email protected]
- Date
- 2020-09-08 00:35:49 -0700 (Tue, 08 Sep 2020)
Log Message
[css-flex] Don't skip flexboxes with auto height for percentage computations in quirks mode
https://bugs.webkit.org/show_bug.cgi?id=216249
Reviewed by Darin Adler.
LayoutTests/imported/w3c:
Fixed the (FAIL) expectations of two WPT tests that are now passing.
* web-platform-tests/css/css-flexbox/percentage-size-quirks-expected.txt: Replaced FAIL with PASS.
* web-platform-tests/css/css-flexbox/quirks-auto-block-size-with-percentage-item-expected.txt: Ditto.
Source/WebCore:
We shouldn't skip flexboxes with height:auto when going up the ancestor chain as we do with other types as grid.
Apart from that, we force flexible box to follow strict mode even when document is in quirks mode as flexbox
was invented way after quirky browsers. This matches Chromium, Edge (pre-Chromium) and Firefox behaviour.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const): Don't skip flexboxes.
* rendering/RenderBoxModelObject.cpp:
(WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const): Ignore quirks mode for flexboxes.
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (266715 => 266716)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2020-09-08 07:35:49 UTC (rev 266716)
@@ -1,3 +1,15 @@
+2020-09-07 Sergio Villar Senin <[email protected]>
+
+ [css-flex] Don't skip flexboxes with auto height for percentage computations in quirks mode
+ https://bugs.webkit.org/show_bug.cgi?id=216249
+
+ Reviewed by Darin Adler.
+
+ Fixed the (FAIL) expectations of two WPT tests that are now passing.
+
+ * web-platform-tests/css/css-flexbox/percentage-size-quirks-expected.txt: Replaced FAIL with PASS.
+ * web-platform-tests/css/css-flexbox/quirks-auto-block-size-with-percentage-item-expected.txt: Ditto.
+
2020-09-07 Chris Dumez <[email protected]>
AudioParam.cancelAndHoldAtTime() is missing
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/percentage-size-quirks-expected.txt (266715 => 266716)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/percentage-size-quirks-expected.txt 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/percentage-size-quirks-expected.txt 2020-09-08 07:35:49 UTC (rev 266716)
@@ -1,21 +1,10 @@
PASS .flexbox 1
PASS .flexbox 2
-FAIL .flexbox 3 assert_equals:
-<div class="flexbox" style="height: auto">
- <div style="height: 10px; min-height: 50%;" data-expected-height="10"></div>
- <div style="height: 50%;" data-expected-height="0"></div>
- <div style="height: 10px; max-height: 50%;" data-expected-height="10"></div>
- <div style="min-height: 10px; height: 100px; max-height: 50%;" data-expected-height="100"></div>
- </div>
-height expected 10 but got 25
+PASS .flexbox 3
PASS .flexbox 4
PASS .flexbox 5
-FAIL .flexbox 6 assert_equals:
-<div class="flexbox">
- <div style="flex: 0 0 50%" data-expected-height="0"></div>
- </div>
-height expected 0 but got 25
+PASS .flexbox 6
PASS .flexbox 7
PASS .flexbox 8
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/quirks-auto-block-size-with-percentage-item-expected.txt (266715 => 266716)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/quirks-auto-block-size-with-percentage-item-expected.txt 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-flexbox/quirks-auto-block-size-with-percentage-item-expected.txt 2020-09-08 07:35:49 UTC (rev 266716)
@@ -2,12 +2,5 @@
-FAIL #container 1 assert_equals:
-<div id="container" style="width:200px; height:456px;">
- <div style="display:flex; background:blue;" data-expected-height="100">
- <img style="width:100px; height: 50%;" src="" data-expected-height="100">
- <div style="width: 50px; height: 100%; background: red;" data-expected-height="0"></div>
- </div>
-</div>
-height expected 100 but got 456
+PASS #container 1
Modified: trunk/Source/WebCore/ChangeLog (266715 => 266716)
--- trunk/Source/WebCore/ChangeLog 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/Source/WebCore/ChangeLog 2020-09-08 07:35:49 UTC (rev 266716)
@@ -1,3 +1,20 @@
+2020-09-07 Sergio Villar Senin <[email protected]>
+
+ [css-flex] Don't skip flexboxes with auto height for percentage computations in quirks mode
+ https://bugs.webkit.org/show_bug.cgi?id=216249
+
+ Reviewed by Darin Adler.
+
+ We shouldn't skip flexboxes with height:auto when going up the ancestor chain as we do with other types as grid.
+
+ Apart from that, we force flexible box to follow strict mode even when document is in quirks mode as flexbox
+ was invented way after quirky browsers. This matches Chromium, Edge (pre-Chromium) and Firefox behaviour.
+
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::skipContainingBlockForPercentHeightCalculation const): Don't skip flexboxes.
+ * rendering/RenderBoxModelObject.cpp:
+ (WebCore::RenderBoxModelObject::hasAutoHeightOrContainingBlockWithAutoHeight const): Ignore quirks mode for flexboxes.
+
2020-09-07 Ryosuke Niwa <[email protected]>
Move all remaining flags from ElementRareData to Node to reduce the frequency
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (266715 => 266716)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2020-09-08 07:35:49 UTC (rev 266716)
@@ -2987,7 +2987,7 @@
// For quirks mode, we skip most auto-height containing blocks when computing
// percentages.
- return document().inQuirksMode() && !containingBlock.isTableCell() && !containingBlock.isOutOfFlowPositioned() && !containingBlock.isRenderGrid() && containingBlock.style().logicalHeight().isAuto();
+ return document().inQuirksMode() && !containingBlock.isTableCell() && !containingBlock.isOutOfFlowPositioned() && !containingBlock.isRenderGrid() && !containingBlock.isFlexibleBoxIncludingDeprecated() && containingBlock.style().logicalHeight().isAuto();
}
bool RenderBox::shouldTreatChildAsReplacedInTableCells() const
Modified: trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp (266715 => 266716)
--- trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2020-09-08 07:21:07 UTC (rev 266715)
+++ trunk/Source/WebCore/rendering/RenderBoxModelObject.cpp 2020-09-08 07:35:49 UTC (rev 266716)
@@ -286,13 +286,12 @@
if (logicalHeightLength.isAuto() && !isOutOfFlowPositionedWithImplicitHeight(*this))
return true;
- if (document().inQuirksMode())
+ // We need the containing block to have a definite block-size in order to resolve the block-size of the descendant,
+ // except when in quirks mode. Flexboxes follow strict behavior even in quirks mode, though.
+ if (!cb || (document().inQuirksMode() && !cb->isFlexibleBoxIncludingDeprecated()))
return false;
- if (cb)
- return !cb->hasDefiniteLogicalHeight();
-
- return false;
+ return !cb->hasDefiniteLogicalHeight();
}
DecodingMode RenderBoxModelObject::decodingModeForImageDraw(const Image& image, const PaintInfo& paintInfo) const
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes