layout: Add *very* basic support for table layout (#31121)

* layout: Add *very* basic support for table layout

This is the first step to proper table layout. It implements a naive
layout algorithm, notably only taking into account the preferred widths
of the first table row. Still, it causes some float tests to start
passing, so turn on the `layout.tables.enabled` preference for those
directories.

Co-authored-by: Oriol Brufau <obrufau@igalia.com>

* Address review comments

* Fix a crash with rowspan=0

* Turn on pref and update results for `/css/css-tables` and `/css/CSS2/tables`

---------

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-01-19 14:20:20 +01:00 committed by GitHub
parent 3d520f2668
commit fc31e69f79
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
115 changed files with 842 additions and 315 deletions

View file

@ -0,0 +1 @@
prefs: ["layout.tables.enabled:true"]

View file

@ -1,2 +0,0 @@
[floats-038.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-149.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-collapse-165.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[margin-collapse-166.xht]
expected: FAIL

View file

@ -0,0 +1 @@
prefs: ["layout.tables.enabled:true"]

View file

@ -0,0 +1,2 @@
[floats-in-table-caption-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-wrap-bfc-001-left-overflow.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-wrap-bfc-001-right-overflow.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-wrap-bfc-003-left-overflow.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-wrap-bfc-003-right-overflow.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[floats-wrap-bfc-007.xht]
expected: FAIL

View file

@ -0,0 +1 @@
prefs: ["layout.tables.enabled:true"]

View file

@ -1,2 +0,0 @@
[border-collapse-offset-002.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-008.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-009.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-010.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-011.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-012.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-013.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[empty-cells-applies-to-017.xht]
expected: FAIL

View file

@ -0,0 +1,2 @@
[height-table-cell-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001a.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001b.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001c.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001d.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[height-width-inline-table-001e.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[separated-border-model-003a.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[separated-border-model-007.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[separated-border-model-008.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[separated-border-model-009.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-017.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-018.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-019.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-020.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-117.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-anonymous-objects-119.xht]
expected: FAIL

View file

@ -1,2 +1,2 @@
[table-anonymous-objects-211.xht]
expected: FAIL
expected: CRASH

View file

@ -1,2 +0,0 @@
[table-column-rendering-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-column-rendering-002.xht]
expected: FAIL

View file

@ -0,0 +1,2 @@
[table-visual-layout-017.xht]
expected: FAIL

View file

@ -0,0 +1 @@
prefs: ["layout.tables.enabled:true"]

View file

@ -0,0 +1,2 @@
[absolute-tables-013.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[absolute-tables-014.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[absolute-tables-015.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[anonymous-table-ws-001.html]
expected: FAIL

View file

@ -1,3 +0,0 @@
[auto-layout-calc-width-001.html]
[#theTable 1]
expected: FAIL

View file

@ -13,3 +13,15 @@
[Table-column-group is 100px tall]
expected: FAIL
[Table-row is 100px wide]
expected: FAIL
[Table-row-group is 100px wide]
expected: FAIL
[Table-column is 100px wide]
expected: FAIL
[Table-column-group is 100px wide]
expected: FAIL

View file

@ -5,9 +5,6 @@
[Control test: Table height is 120px]
expected: FAIL
[First (empty) table-row-group is 0px wide]
expected: FAIL
[First (empty) table-row-group should be located at 10px left]
expected: FAIL
@ -22,3 +19,6 @@
[Second table-row-group should be located at 10px top]
expected: FAIL
[Second table-row-group is 100px tall]
expected: FAIL

View file

@ -1,3 +1,6 @@
[caption-side-1.html]
[Caption-side inherits and reorder captions properly]
expected: FAIL
[Multiple captions can be rendered]
expected: FAIL

View file

@ -1,2 +0,0 @@
[col-definite-max-size-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[col-definite-min-size-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[col-definite-size-001.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[collapsed-border-paint-phase-001.html]
expected: FAIL

View file

@ -5,9 +5,6 @@
[main table 2]
expected: FAIL
[main table 3]
expected: FAIL
[main table 4]
expected: FAIL
@ -34,3 +31,6 @@
[main table 13]
expected: FAIL
[main table 9]
expected: FAIL

View file

@ -1,9 +1,6 @@
[fixed-layout-1.html]
[Table-layout:fixed distributes width equally to all auto-columns]
[Table-layout:fixed grows the table if needed for minimum-width]
expected: FAIL
[Table-layout:fixed deals with columns generated by subsequent rows]
expected: FAIL
[Table-layout:fixed ignores sizes specified by subsequent rows]
[Table-layout:fixed takes visual order into account, not dom order]
expected: FAIL

View file

@ -1,15 +1,6 @@
[fixed-layout-2.html]
[Table-layout:fixed is not applied when width is auto]
expected: FAIL
[Table-layout:fixed reports fixed when width is auto]
expected: FAIL
[Table-layout:fixed is not applied when width is max-content]
expected: FAIL
[Table-layout:fixed reports fixed when width is max-content]
expected: FAIL
[Table-layout:fixed is applied when width is min-content]
expected: FAIL

View file

@ -1,3 +0,0 @@
[fixed-layout-calc-width-001.html]
[#theTable 1]
expected: FAIL

View file

@ -0,0 +1,2 @@
[fixup-dynamic-anonymous-inline-table-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[fixup-dynamic-anonymous-inline-table-002.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[fixup-dynamic-anonymous-inline-table-003.html]
expected: FAIL

View file

@ -4,3 +4,9 @@
[Checking intermediate min-content height for span 1 (3)]
expected: FAIL
[Checking intermediate min-content height for span 1 (2)]
expected: FAIL
[Checking intermediate min-content height for span 1 (4)]
expected: FAIL

View file

@ -11,11 +11,5 @@
[Unresolvable percentage widths are resolved as auto in first pass (replaced elements)]
expected: FAIL
[Unresolvable percentage widths are resolved as auto in first pass (unscrollable overflow)]
expected: FAIL
[Unresolvable percentage widths are resolved as auto in first pass (scrollable overflow)]
expected: FAIL
[Unresolvable percentage heights are resolved as 0px in first pass (scrollable overflow)]
expected: FAIL

View file

@ -0,0 +1,2 @@
[td-different-subpixel-padding-in-same-row-vertical-rl.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[td-different-subpixel-padding-in-same-row.html]
expected: FAIL

View file

@ -31,3 +31,6 @@
[Border-spacing is added between any two unmerged rows (5)]
expected: FAIL
[Explicitely defined rows are not merged]
expected: FAIL

View file

@ -0,0 +1,3 @@
[percent-height-overflow-auto-in-restricted-block-size-cell.html]
[#container 1]
expected: FAIL

View file

@ -1,2 +0,0 @@
[percent-height-overflow-auto-in-unrestricted-block-size-cell.tentative.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[row-group-margin-border-padding.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[row-group-order.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[row-margin-border-padding.html]
expected: FAIL

View file

@ -1,2 +0,0 @@
[rules-groups.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[subpixel-table-cell-height-001.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[table-cell-child-overflow-measure.html]
expected: FAIL

View file

@ -0,0 +1,2 @@
[table-cell-overflow-auto.html]
expected: FAIL

View file

@ -1,4 +1,5 @@
[table-model-fixup-2.html]
expected: CRASH
[Replaced elements inside a table cannot be table-row and are considered inline -- input elements (top)]
expected: FAIL

View file

@ -1,10 +1,4 @@
[table-model-fixup.html]
[1.1. Children of a table-column are treated as if they had display: none.]
expected: FAIL
[1.2. Children of a table-column-group which are not a table-column are treated as if they had display: none.]
expected: FAIL
[2.1. An anonymous table-row box must be generated around each sequence of consecutive children of a table-root box which are not proper table child boxes. (1/2)]
expected: FAIL
@ -22,3 +16,9 @@
[3.2. An anonymous table or inline-table box must be generated around each sequence of consecutive proper table child box which are misparented]
expected: FAIL
[2.2. An anonymous table-row box must be generated around each sequence of consecutive children of a table-row-grouping box which are not table-row boxes. (3/3)]
expected: FAIL
[1.4. Anonymous inline boxes which contains only white space and are between two immediate siblings *each* of which is a table-non-root element, are treated as if they had display: none.]
expected: FAIL

View file

@ -1,10 +1,4 @@
[baseline-table.html]
[.container 1]
expected: FAIL
[.container 2]
expected: FAIL
[.container 3]
expected: FAIL
@ -17,18 +11,6 @@
[.container 6]
expected: FAIL
[.container 7]
expected: FAIL
[.container 8]
expected: FAIL
[.container 9]
expected: FAIL
[.container 10]
expected: FAIL
[.container 11]
expected: FAIL
@ -40,6 +22,3 @@
[.container 14]
expected: FAIL
[.container 15]
expected: FAIL

View file

@ -22,3 +22,15 @@
[table 10]
expected: FAIL
[table 4]
expected: FAIL
[table 5]
expected: FAIL
[table 12]
expected: FAIL
[table 13]
expected: FAIL

View file

@ -59,9 +59,6 @@
[table 20]
expected: FAIL
[table 21]
expected: FAIL
[table 22]
expected: FAIL

View file

@ -64,3 +64,6 @@
[table 24]
expected: FAIL
[table 20]
expected: FAIL

View file

@ -5,11 +5,5 @@
[table 2]
expected: FAIL
[table 3]
expected: FAIL
[table 5]
expected: FAIL
[table 6]
expected: FAIL

View file

@ -31,3 +31,6 @@
[table 12]
expected: FAIL
[table 10]
expected: FAIL

View file

@ -2,20 +2,5 @@
[.t 6]
expected: FAIL
[.t 10]
expected: FAIL
[.t 11]
expected: FAIL
[.t 12]
expected: FAIL
[.t 13]
expected: FAIL
[.t 14]
expected: FAIL
[.t 15]
expected: FAIL

View file

@ -13,3 +13,21 @@
[table 11]
expected: FAIL
[table 1]
expected: FAIL
[table 4]
expected: FAIL
[table 5]
expected: FAIL
[table 6]
expected: FAIL
[table 7]
expected: FAIL
[table 10]
expected: FAIL

View file

@ -1,2 +0,0 @@
[th-text-align.html]
expected: FAIL

View file

@ -1,6 +1,3 @@
[visibility-collapse-col-005.html]
[col visibility:collapse doesn't change table height]
expected: FAIL
[col visibility:collapse changes table width]
expected: FAIL

View file

@ -1,6 +1,3 @@
[visibility-collapse-colspan-001.html]
[col visibility:collapse doesn't change table height]
expected: FAIL
[col visibility:collapse changes table width]
expected: FAIL

View file

@ -1,6 +1,3 @@
[visibility-collapse-colspan-002.html]
[col visibility:collapse doesn't change table height]
expected: FAIL
[col visibility:collapse changes table width]
expected: FAIL

View file

@ -1,6 +0,0 @@
[visibility-collapse-row-005.html]
[collapsed row should not contribute to overflow]
expected: FAIL
[collapsed section should not contribute to overflow]
expected: FAIL

View file

@ -1,9 +1,3 @@
[visibility-collapse-row-group-001.html]
[row group visibility:collapse changes table height]
expected: FAIL
[the first row should be collapsed]
expected: FAIL
[the second row should be collapsed]
expected: FAIL

View file

@ -1,6 +1,3 @@
[visibility-collapse-rowspan-002-border-separate.html]
[spanning row visibility:collapse makes row height 0]
expected: FAIL
[spanning cell shrinks to sum of remaining three rows' height]
expected: FAIL

View file

@ -1,6 +1,3 @@
[visibility-collapse-rowspan-002.html]
[spanning row visibility:collapse makes row height 0]
expected: FAIL
[spanning cell shrinks to sum of remaining three rows' height]
expected: FAIL

View file

@ -1,3 +0,0 @@
[visibility-collapse-rowspan-003-border-separate.html]
[collapsed row has zero height]
expected: FAIL

View file

@ -1,3 +0,0 @@
[visibility-collapse-rowspan-003.html]
[collapsed row has zero height]
expected: FAIL

View file

@ -1,12 +1,6 @@
[visibility-collapse-rowspan-004-dynamic.html]
[third row visibility:collapse makes row height 0]
expected: FAIL
[spanning cell shrinks to sum of remaining three rows' height]
expected: FAIL
[(2nd collapse) third row visibility:collapse makes row height 0]
expected: FAIL
[(2nd collapse) spanning cell shrinks to sum of remaining three rows' height]
expected: FAIL

View file

@ -1,3 +0,0 @@
[visibility-hidden-row-001.html]
[Table height is 222px]
expected: FAIL

View file

@ -1,3 +0,0 @@
[visibility-hidden-row-002.html]
[Table height is 222px]
expected: FAIL

View file

@ -0,0 +1,2 @@
[whitespace-001.html]
expected: FAIL

Some files were not shown because too many files have changed in this diff Show more