From 2c4e77d64dede5fb7f4a88626291d4c79c6c3952 Mon Sep 17 00:00:00 2001 From: David Grogan Date: Fri, 19 Jul 2019 19:44:08 +0000 Subject: [PATCH] Bug 1561198 [wpt PR 17432] - LayoutNG: Fix sizing and position of abspos tables, a=testonly Automatic update from web-platform-tests LayoutNG: Fix sizing and position of abspos tables LayoutBox::ContainingBlockLogicalHeightForPercentageResolution was adding padding but only for tables. NG already supplies padding so don't do this table exception if the containing block is NG. ng_absolute_utils relied on specified table width/height being the final say, but tables use those as another min size. This patch makes ng_absolute_utils treat table height/width as Auto for main sizing and uses it as another min-height/width. ResolveInlineLengthInternal assumes that anything with inline size Auto will expand to fill the available space, but tables do not. The 4-argument version of ComputeMinAndMaxContentContribution makes a similar assumption to ng_absolute_utils -- if a node has a width set, that's the final width. The 3-argument version of ComputeMinAndMaxContentContribution is aware of this so bypasses the 4-argument version for tables and instead uses legacy preferred width calculations, so I made ComputeMinAndMaxContentSizeForOutOfFlow do the same. The tests all at least partially failed in NG before this patch. After this patch, NG matches legacy everywhere, except for the first 2 cases of -002.html, which were broken in legacy and NG before this patch. It is now correct in NG. We partially fail 003 and 005, but identically to legacy layout. I added more checks to fast/table/absolute-table-percent-lengths.html and moved it to the wpt repository as css/css-tables/absolute-tables-001.html . Bug: 973390 Change-Id: I8cea275b2ca19492a501b84cd86456ed6745a4b8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1671851 Commit-Queue: David Grogan Reviewed-by: Morten Stenshorne Reviewed-by: Aleks Totic Cr-Commit-Position: refs/heads/master@{#675142} -- wpt-commits: 8e3db7f3a765d1783f7e8c068c8bf90de61b1f66 wpt-pr: 17432 --- .../css/css-tables/absolute-tables-001.html | 90 +++++++++++++++++++ .../css/css-tables/absolute-tables-002.html | 79 ++++++++++++++++ .../css/css-tables/absolute-tables-003.html | 79 ++++++++++++++++ .../css/css-tables/absolute-tables-004.html | 79 ++++++++++++++++ .../css/css-tables/absolute-tables-005.html | 79 ++++++++++++++++ 5 files changed, 406 insertions(+) create mode 100644 testing/web-platform/tests/css/css-tables/absolute-tables-001.html create mode 100644 testing/web-platform/tests/css/css-tables/absolute-tables-002.html create mode 100644 testing/web-platform/tests/css/css-tables/absolute-tables-003.html create mode 100644 testing/web-platform/tests/css/css-tables/absolute-tables-004.html create mode 100644 testing/web-platform/tests/css/css-tables/absolute-tables-005.html diff --git a/testing/web-platform/tests/css/css-tables/absolute-tables-001.html b/testing/web-platform/tests/css/css-tables/absolute-tables-001.html new file mode 100644 index 000000000000..dd401c237907 --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/absolute-tables-001.html @@ -0,0 +1,90 @@ + + + + + + + + + + +

Tests that percent lengths of an absolutely positioned table is resolved +against the padding box of the parent. +


+ +
+
+ + abc + +
+
+ + abc + +
+
+ + abc + +
+
+ + abc + +
+ +
+ + abc + +
+
+ + abc + +
+
+ + abc + +
+
+ + abc + +
+
+ diff --git a/testing/web-platform/tests/css/css-tables/absolute-tables-002.html b/testing/web-platform/tests/css/css-tables/absolute-tables-002.html new file mode 100644 index 000000000000..a72e2f170e36 --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/absolute-tables-002.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + +
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ diff --git a/testing/web-platform/tests/css/css-tables/absolute-tables-003.html b/testing/web-platform/tests/css/css-tables/absolute-tables-003.html new file mode 100644 index 000000000000..352d8cd6270c --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/absolute-tables-003.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + +
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ diff --git a/testing/web-platform/tests/css/css-tables/absolute-tables-004.html b/testing/web-platform/tests/css/css-tables/absolute-tables-004.html new file mode 100644 index 000000000000..a74d7dfbd02f --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/absolute-tables-004.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + +
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ diff --git a/testing/web-platform/tests/css/css-tables/absolute-tables-005.html b/testing/web-platform/tests/css/css-tables/absolute-tables-005.html new file mode 100644 index 000000000000..57c3f0dea3a5 --- /dev/null +++ b/testing/web-platform/tests/css/css-tables/absolute-tables-005.html @@ -0,0 +1,79 @@ + + + + + + + + + + + + +
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+ + + + +
+
+
+
+
+