Commit 3ea149a
Fix table layout to properly handle visibility:collapse on columns
https://bugs.webkit.org/show_bug.cgi?id=305905
rdar://168556786
Reviewed by Alan Baradlay.
This patch aligns WebKit with Gecko / Firefox and Blink / Chromium.
Columns with visibility:collapse should not contribute to table width
calculations. This patch modifies AutoTableLayout to:
1. Skip collapsed columns in recalcColumn() by setting their min/max
widths to 0 early.
2. Skip collapsed columns throughout layout() when distributing
available width to columns.
3. Skip adding border-spacing after collapsed columns when calculating
column positions.
Previously, collapsed columns were treated as normal columns and
received width allocation, causing tables to be wider than expected.
* LayoutTests/TestExpectations:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-col-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-col-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-col-003-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-col-004-dynamic-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-col-005-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-colspan-002-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-rowcol-001-expected.txt:
* LayoutTests/imported/w3c/web-platform-tests/css/css-tables/visibility-collapse-rowcol-002-expected.txt:
* LayoutTests/platform/glib/tables/mozilla_expected_failures/other/test4-expected.txt:
* LayoutTests/platform/ios/tables/mozilla_expected_failures/other/test4-expected.txt:
* LayoutTests/platform/mac/tables/mozilla_expected_failures/other/test4-expected.txt:
* Source/WebCore/rendering/AutoTableLayout.cpp:
(WebCore::AutoTableLayout::recalcColumn):
(WebCore::AutoTableLayout::layout):
Canonical link: https://commits.webkit.org/305997@main1 parent 9a74e87 commit 3ea149a
File tree
13 files changed
+322
-251
lines changed- LayoutTests
- imported/w3c/web-platform-tests/css/css-tables
- platform
- glib/tables/mozilla_expected_failures/other
- ios/tables/mozilla_expected_failures/other
- mac/tables/mozilla_expected_failures/other
- Source/WebCore/rendering
13 files changed
+322
-251
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7883 | 7883 | | |
7884 | 7884 | | |
7885 | 7885 | | |
7886 | | - | |
7887 | | - | |
7888 | 7886 | | |
7889 | 7887 | | |
7890 | 7888 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
| 15 | + | |
16 | 16 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
Lines changed: 86 additions & 80 deletions
Large diffs are not rendered by default.
0 commit comments