Title: [261996] trunk
- Revision
- 261996
- Author
- [email protected]
- Date
- 2020-05-21 07:45:18 -0700 (Thu, 21 May 2020)
Log Message
Source/WebCore:
[css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
https://bugs.webkit.org/show_bug.cgi?id=191365
Reviewed by Manuel Rego Casasnovas.
Automatic table layout algorithm generates infinite width tables
(tableMaxWidth to be more exact) when the sum of the columns percentages
exceed the 100% value and there is at least one non-percentage based
column with positive width as in those cases it's impossible to fulfill
the table constrains. That should not be done in the case of the table
being a flex or a grid item because they both define new formatting
contexts.
Based on Blink's crrev.com/1095220 by <[email protected]>
* rendering/AutoTableLayout.cpp:
(WebCore::shouldScaleColumnsForParent): return false when the table is
either a grid or a flex item.
LayoutTests:
[css-grid] width of table in a grid is incorrect when table cell has width:100%
https://bugs.webkit.org/show_bug.cgi?id=191365
Reviewed by Manuel Rego Casasnovas.
* TestExpectations: Unskipped 3 tests that are now passing.
Modified Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (261995 => 261996)
--- trunk/LayoutTests/ChangeLog 2020-05-21 14:41:12 UTC (rev 261995)
+++ trunk/LayoutTests/ChangeLog 2020-05-21 14:45:18 UTC (rev 261996)
@@ -1,3 +1,12 @@
+2020-05-21 Sergio Villar Senin <[email protected]>
+
+ [css-grid] width of table in a grid is incorrect when table cell has width:100%
+ https://bugs.webkit.org/show_bug.cgi?id=191365
+
+ Reviewed by Manuel Rego Casasnovas.
+
+ * TestExpectations: Unskipped 3 tests that are now passing.
+
2020-05-21 Diego Pino Garcia <[email protected]>
[WPE] Gardening, update WAV baseline for webaudio test
Modified: trunk/LayoutTests/TestExpectations (261995 => 261996)
--- trunk/LayoutTests/TestExpectations 2020-05-21 14:41:12 UTC (rev 261995)
+++ trunk/LayoutTests/TestExpectations 2020-05-21 14:45:18 UTC (rev 261996)
@@ -1058,8 +1058,6 @@
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-010.html [ Pass Failure ]
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-013.html [ Pass Failure ]
imported/w3c/web-platform-tests/css/css-grid/abspos/orthogonal-positioned-grid-descendants-015.html [ Pass Failure ]
-webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/item-with-table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
-webkit.org/b/191365 imported/w3c/web-platform-tests/css/css-grid/grid-items/table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
webkit.org/b/191367 imported/w3c/web-platform-tests/css/css-grid/grid-model/grid-container-ignores-first-letter-002.html [ ImageOnlyFailure ]
webkit.org/b/191460 imported/w3c/web-platform-tests/css/css-grid/grid-items/anonymous-grid-item-001.html [ Skip ]
webkit.org/b/191461 imported/w3c/web-platform-tests/css/css-grid/grid-items/percentage-size-subitems-001.html [ ImageOnlyFailure ]
@@ -4245,7 +4243,6 @@
webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-001.html [ ImageOnlyFailure ]
webkit.org/b/210093 imported/w3c/web-platform-tests/css/css-flexbox/select-element-zero-height-002.html [ ImageOnlyFailure ]
webkit.org/b/210102 imported/w3c/web-platform-tests/css/css-flexbox/table-as-item-auto-min-width.html [ ImageOnlyFailure ]
-webkit.org/b/210103 imported/w3c/web-platform-tests/css/css-flexbox/item-with-table-with-infinite-max-intrinsic-width.html [ ImageOnlyFailure ]
webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-004.html [ ImageOnlyFailure ]
webkit.org/b/210144 imported/w3c/web-platform-tests/css/css-flexbox/anonymous-flex-item-005.html [ ImageOnlyFailure ]
webkit.org/b/210465 imported/w3c/web-platform-tests/css/css-flexbox/flex-wrap-002.html [ ImageOnlyFailure ]
Modified: trunk/Source/WebCore/ChangeLog (261995 => 261996)
--- trunk/Source/WebCore/ChangeLog 2020-05-21 14:41:12 UTC (rev 261995)
+++ trunk/Source/WebCore/ChangeLog 2020-05-21 14:45:18 UTC (rev 261996)
@@ -1,3 +1,24 @@
+2020-05-21 Sergio Villar Senin <[email protected]>
+
+ [css-grid] [css-flex] Width of table as grid/flex item is infinite when the sum of columns' width exceed 100%
+ https://bugs.webkit.org/show_bug.cgi?id=191365
+
+ Reviewed by Manuel Rego Casasnovas.
+
+ Automatic table layout algorithm generates infinite width tables
+ (tableMaxWidth to be more exact) when the sum of the columns percentages
+ exceed the 100% value and there is at least one non-percentage based
+ column with positive width as in those cases it's impossible to fulfill
+ the table constrains. That should not be done in the case of the table
+ being a flex or a grid item because they both define new formatting
+ contexts.
+
+ Based on Blink's crrev.com/1095220 by <[email protected]>
+
+ * rendering/AutoTableLayout.cpp:
+ (WebCore::shouldScaleColumnsForParent): return false when the table is
+ either a grid or a flex item.
+
2020-05-21 Zalan Bujtas <[email protected]>
[ macOS debug ] REGRESSION: fast/layoutformattingcontext/table-basic-row-baseline-with-nested-table.html is a flaky crash
Modified: trunk/Source/WebCore/rendering/AutoTableLayout.cpp (261995 => 261996)
--- trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2020-05-21 14:41:12 UTC (rev 261995)
+++ trunk/Source/WebCore/rendering/AutoTableLayout.cpp 2020-05-21 14:45:18 UTC (rev 261996)
@@ -23,6 +23,8 @@
#include "AutoTableLayout.h"
#include "RenderChildIterator.h"
+#include "RenderFlexibleBox.h"
+#include "RenderGrid.h"
#include "RenderTable.h"
#include "RenderTableCell.h"
#include "RenderTableCol.h"
@@ -189,6 +191,13 @@
// on the cell contents' preferred widths.
if (is<RenderTableCell>(containingBlock))
return false;
+ // The max logical width of a table may be "infinity" (or tableMaxWidth, to be more exact) if the sum if the
+ // columns' percentages is 100% or more, AND there is at least one column that has a non-percentage-based positive
+ // logical width. In such situations no table logical width will be large enough to satisfy the constraint
+ // set by the contents. So the idea is to use ~infinity to make sure we use all available size in the containing
+ // block. However, this just doesn't work if this is a flex or grid item, so disallow scaling in that case.
+ if (is<RenderFlexibleBox>(containingBlock) || is<RenderGrid>(containingBlock))
+ return false;
containingBlock = containingBlock->containingBlock();
}
return true;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes