layout: Add support for table rows, columns, rowgroups and colgroups (#31341)

This adds support for table rows, columns, rowgroups and colgroups.
There are few additions here:

1. The createion of fragments, which allows script queries and hit
   testing to work properly. These fragments are empty as all cells are
   still direct descendants of the table fragment.
2. Properly handling size information from tracks and track groups as
   well as frustrating rules about reordering rowgroups.
3. Painting a background seemlessly across track groups and groups. This
   is a thing that isn't done in legacy layout (nor WebKit)!

Co-authored-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
Martin Robinson 2024-02-20 14:22:02 +01:00 committed by GitHub
parent 74c07db56c
commit 02ae1f448e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
57 changed files with 4274 additions and 21000 deletions

View file

@ -1,6 +0,0 @@
[HTMLTableColElement.html]
[span on HTMLTableColElement must enqueue an attributeChanged reaction when adding a new attribute]
expected: FAIL
[span on HTMLTableColElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

View file

@ -3282,9 +3282,6 @@
[HTMLTableElement interface: attribute frame]
expected: FAIL
[HTMLTableColElement interface: document.createElement("colgroup") must inherit property "span" with the proper type]
expected: FAIL
[HTMLParamElement interface: attribute valueType]
expected: FAIL
@ -4005,9 +4002,6 @@
[HTMLAreaElement interface: attribute hostname]
expected: FAIL
[HTMLTableColElement interface: attribute span]
expected: FAIL
[HTMLSlotElement interface object name]
expected: FAIL
@ -4422,9 +4416,6 @@
[HTMLFrameElement interface: attribute scrolling]
expected: FAIL
[HTMLTableColElement interface: document.createElement("col") must inherit property "span" with the proper type]
expected: FAIL
[HTMLElement interface: document.createElement("noscript") must inherit property "accessKeyLabel" with the proper type]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-backgrounds-bs-colgroup-001.xht]
expected: FAIL

View file

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

View file

@ -1,2 +0,0 @@
[table-backgrounds-bs-row-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[table-backgrounds-bs-rowgroup-001.xht]
expected: FAIL

View file

@ -1,2 +0,0 @@
[border-collapse-rowspan-cell.html]
expected: FAIL

View file

@ -2,26 +2,14 @@
[Table-cell is 100px tall]
expected: FAIL
[Table-row is 100px wide]
expected: FAIL
[Table-row is 100px tall]
expected: FAIL
[Table-row-group is 100px wide]
expected: FAIL
[Table-row-group is 100px tall]
expected: FAIL
[Table-column is 100px wide]
expected: FAIL
[Table-column is 100px tall]
expected: FAIL
[Table-column-group is 100px wide]
expected: FAIL
[Table-column-group is 100px tall]
expected: FAIL

View file

@ -13,15 +13,3 @@
[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

@ -7,15 +7,3 @@
[First (empty) table-row-group should be located at 10px top]
expected: FAIL
[Second table-row-group is 100px wide]
expected: FAIL
[Second table-row-group should be located at 10px left]
expected: FAIL
[Second table-row-group should be located at 10px top]
expected: FAIL
[Second table-row-group is 100px tall]
expected: FAIL

View file

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

View file

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

View file

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

View file

@ -5,8 +5,5 @@
[Checking intermediate min-content width for span 2 (2)]
expected: FAIL
[Checking intermediate min-content width for span 2 (3)]
expected: FAIL
[Checking intermediate min-content width for span 2 (4)]
expected: FAIL

View file

@ -2,9 +2,6 @@
[HTML -> CSS Mapping is applied correctly on proper table markup (border-spacing, padding)]
expected: FAIL
[HTML -> CSS Mapping is applied correctly on improper table markup (no table => no border-spacing, but padding)]
expected: FAIL
[HTML -> CSS Mapping is applied correctly on improper table markup (no td => border-spacing, but no padding)]
expected: FAIL

View file

@ -0,0 +1,2 @@
[col-paint-htb-rtl.html]
expected: FAIL

View file

@ -7,3 +7,12 @@
[Replaced elements inside a table cannot be table-row and are considered inline -- input elements (width)]
expected: FAIL
[Replaced elements inside a table cannot be table-row and are considered inline -- input elements (top)]
expected: FAIL
[Replaced elements inside a table cannot be table-column and are considered inline -- input elements (top)]
expected: FAIL
[Replaced elements outside a table cannot be table-row and are considered inline -- input=file elements]
expected: FAIL

View file

@ -11,9 +11,6 @@
[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. (2/3)]
expected: FAIL
[2.3 happens after 2.1. and 2.2. (2/2)]
expected: FAIL
[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
@ -22,3 +19,6 @@
[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
[2.3 happens after 2.1. and 2.2. (1/2)]
expected: FAIL

View file

@ -7,3 +7,6 @@
[.container 13]
expected: FAIL
[.container 3]
expected: FAIL

View file

@ -82,3 +82,6 @@
[table 31]
expected: FAIL
[table 8]
expected: FAIL

View file

@ -1,6 +1,3 @@
[element-sizing.html]
[table 1]
expected: FAIL
[table 2]
expected: FAIL

View file

@ -23,27 +23,12 @@
[table 9]
expected: FAIL
[table 10]
expected: FAIL
[table 11]
expected: FAIL
[table 12]
expected: FAIL
[table 13]
expected: FAIL
[table 14]
expected: FAIL
[table 15]
expected: FAIL
[table 16]
expected: FAIL
[table 17]
expected: FAIL
@ -62,8 +47,5 @@
[table 23]
expected: FAIL
[table 24]
expected: FAIL
[table 20]
expected: FAIL

View file

@ -1,10 +1,4 @@
[td-box-sizing-003.html]
[table 2]
expected: FAIL
[table 3]
expected: FAIL
[table 8]
expected: FAIL

View file

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

View file

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

View file

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

View file

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

View file

@ -4,3 +4,9 @@
[(2nd collapse) spanning cell shrinks to sum of remaining three rows' height]
expected: FAIL
[third row visibility:collapse makes row height 0]
expected: FAIL
[(2nd collapse) third row visibility:collapse makes row height 0]
expected: FAIL

View file

@ -1,6 +0,0 @@
[HTMLTableColElement.html]
[span on HTMLTableColElement must enqueue an attributeChanged reaction when adding a new attribute]
expected: FAIL
[span on HTMLTableColElement must enqueue an attributeChanged reaction when replacing an existing attribute]
expected: FAIL

View file

@ -3432,9 +3432,6 @@
[HTMLAreaElement interface: attribute origin]
expected: FAIL
[HTMLTableColElement interface: document.createElement("colgroup") must inherit property "span" with the proper type]
expected: FAIL
[HTMLTableSectionElement interface: attribute chOff]
expected: FAIL
@ -3831,9 +3828,6 @@
[HTMLAreaElement interface: attribute hostname]
expected: FAIL
[HTMLTableColElement interface: attribute span]
expected: FAIL
[HTMLTableElement interface: document.createElement("table") must inherit property "border" with the proper type]
expected: FAIL
@ -4221,9 +4215,6 @@
[HTMLFrameElement interface: attribute scrolling]
expected: FAIL
[HTMLTableColElement interface: document.createElement("col") must inherit property "span" with the proper type]
expected: FAIL
[HTMLElement interface: document.createElement("noscript") must inherit property "accessKeyLabel" with the proper type]
expected: FAIL

View file

@ -1829,30 +1829,6 @@
[colgroup.tabIndex: IDL set to -2147483648]
expected: FAIL
[colgroup.span: typeof IDL attribute]
expected: FAIL
[colgroup.span: IDL get with DOM attribute unset]
expected: FAIL
[colgroup.span: setAttribute() to -2147483649]
expected: FAIL
[colgroup.span: setAttribute() to -2147483648]
expected: FAIL
[colgroup.span: setAttribute() to -36]
expected: FAIL
[colgroup.span: setAttribute() to -1]
expected: FAIL
[colgroup.span: setAttribute() to 0]
expected: FAIL
[colgroup.span: setAttribute() to 1]
expected: FAIL
[colgroup.span: setAttribute() to 2147483647]
expected: FAIL
@ -1865,171 +1841,18 @@
[colgroup.span: setAttribute() to 4294967296]
expected: FAIL
[colgroup.span: setAttribute() to ""]
expected: FAIL
[colgroup.span: setAttribute() to "-1"]
expected: FAIL
[colgroup.span: setAttribute() to "-0"]
expected: FAIL
[colgroup.span: setAttribute() to "0"]
expected: FAIL
[colgroup.span: setAttribute() to "1"]
expected: FAIL
[colgroup.span: setAttribute() to "\\t7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\v7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\f7"]
expected: FAIL
[colgroup.span: setAttribute() to " 7"]
expected: FAIL
[colgroup.span: setAttribute() to " 7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\n7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\r7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to " 7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to "7"]
expected: FAIL
[colgroup.span: setAttribute() to " 7"]
expected: FAIL
[colgroup.span: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
expected: FAIL
[colgroup.span: setAttribute() to undefined]
expected: FAIL
[colgroup.span: setAttribute() to 1.5]
expected: FAIL
[colgroup.span: setAttribute() to "5%"]
expected: FAIL
[colgroup.span: setAttribute() to "+100"]
expected: FAIL
[colgroup.span: setAttribute() to ".5"]
expected: FAIL
[colgroup.span: setAttribute() to true]
expected: FAIL
[colgroup.span: setAttribute() to false]
expected: FAIL
[colgroup.span: setAttribute() to object "[object Object\]"]
expected: FAIL
[colgroup.span: setAttribute() to NaN]
expected: FAIL
[colgroup.span: setAttribute() to Infinity]
expected: FAIL
[colgroup.span: setAttribute() to -Infinity]
expected: FAIL
[colgroup.span: setAttribute() to "\\0"]
expected: FAIL
[colgroup.span: setAttribute() to object "2"]
expected: FAIL
[colgroup.span: setAttribute() to object "3"]
expected: FAIL
[colgroup.span: setAttribute() to 1000]
expected: FAIL
[colgroup.span: setAttribute() to 1001]
expected: FAIL
[colgroup.span: IDL set to 0]
expected: FAIL
[colgroup.span: IDL set to 1]
expected: FAIL
[colgroup.span: IDL set to 257]
expected: FAIL
[colgroup.span: IDL set to 2147483647]
expected: FAIL
[colgroup.span: IDL set to "-0"]
expected: FAIL
[colgroup.span: IDL set to 2147483648]
expected: FAIL
[colgroup.span: IDL set to 4294967295]
expected: FAIL
[colgroup.span: IDL set to 1000]
expected: FAIL
[colgroup.span: IDL set to 1001]
expected: FAIL
@ -2909,30 +2732,6 @@
[col.tabIndex: IDL set to -2147483648]
expected: FAIL
[col.span: typeof IDL attribute]
expected: FAIL
[col.span: IDL get with DOM attribute unset]
expected: FAIL
[col.span: setAttribute() to -2147483649]
expected: FAIL
[col.span: setAttribute() to -2147483648]
expected: FAIL
[col.span: setAttribute() to -36]
expected: FAIL
[col.span: setAttribute() to -1]
expected: FAIL
[col.span: setAttribute() to 0]
expected: FAIL
[col.span: setAttribute() to 1]
expected: FAIL
[col.span: setAttribute() to 2147483647]
expected: FAIL
@ -2945,171 +2744,18 @@
[col.span: setAttribute() to 4294967296]
expected: FAIL
[col.span: setAttribute() to ""]
expected: FAIL
[col.span: setAttribute() to "-1"]
expected: FAIL
[col.span: setAttribute() to "-0"]
expected: FAIL
[col.span: setAttribute() to "0"]
expected: FAIL
[col.span: setAttribute() to "1"]
expected: FAIL
[col.span: setAttribute() to "\\t7"]
expected: FAIL
[col.span: setAttribute() to "\\v7"]
expected: FAIL
[col.span: setAttribute() to "\\f7"]
expected: FAIL
[col.span: setAttribute() to " 7"]
expected: FAIL
[col.span: setAttribute() to " 7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "\\n7"]
expected: FAIL
[col.span: setAttribute() to "\\r7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to " 7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to "7"]
expected: FAIL
[col.span: setAttribute() to " 7"]
expected: FAIL
[col.span: setAttribute() to " \\0\\x01\\x02\\x03\\x04\\x05\\x06\\x07 \\b\\t\\n\\v\\f\\r\\x0e\\x0f \\x10\\x11\\x12\\x13\\x14\\x15\\x16\\x17 \\x18\\x19\\x1a\\x1b\\x1c\\x1d\\x1e\\x1f foo "]
expected: FAIL
[col.span: setAttribute() to undefined]
expected: FAIL
[col.span: setAttribute() to 1.5]
expected: FAIL
[col.span: setAttribute() to "5%"]
expected: FAIL
[col.span: setAttribute() to "+100"]
expected: FAIL
[col.span: setAttribute() to ".5"]
expected: FAIL
[col.span: setAttribute() to true]
expected: FAIL
[col.span: setAttribute() to false]
expected: FAIL
[col.span: setAttribute() to object "[object Object\]"]
expected: FAIL
[col.span: setAttribute() to NaN]
expected: FAIL
[col.span: setAttribute() to Infinity]
expected: FAIL
[col.span: setAttribute() to -Infinity]
expected: FAIL
[col.span: setAttribute() to "\\0"]
expected: FAIL
[col.span: setAttribute() to object "2"]
expected: FAIL
[col.span: setAttribute() to object "3"]
expected: FAIL
[col.span: setAttribute() to 1000]
expected: FAIL
[col.span: setAttribute() to 1001]
expected: FAIL
[col.span: IDL set to 0]
expected: FAIL
[col.span: IDL set to 1]
expected: FAIL
[col.span: IDL set to 257]
expected: FAIL
[col.span: IDL set to 2147483647]
expected: FAIL
[col.span: IDL set to "-0"]
expected: FAIL
[col.span: IDL set to 2147483648]
expected: FAIL
[col.span: IDL set to 4294967295]
expected: FAIL
[col.span: IDL set to 1000]
expected: FAIL
[col.span: IDL set to 1001]
expected: FAIL
@ -7037,9 +6683,6 @@
[td.tabIndex: IDL set to -2147483648]
expected: FAIL
[td.colSpan: setAttribute() to 0]
expected: FAIL
[td.colSpan: setAttribute() to 2147483647]
expected: FAIL
@ -7052,12 +6695,6 @@
[td.colSpan: setAttribute() to 4294967296]
expected: FAIL
[td.colSpan: setAttribute() to "-0"]
expected: FAIL
[td.colSpan: setAttribute() to "0"]
expected: FAIL
[td.colSpan: setAttribute() to 1001]
expected: FAIL
@ -8660,9 +8297,6 @@
[th.tabIndex: IDL set to -2147483648]
expected: FAIL
[th.colSpan: setAttribute() to 0]
expected: FAIL
[th.colSpan: setAttribute() to 2147483647]
expected: FAIL
@ -8675,12 +8309,6 @@
[th.colSpan: setAttribute() to 4294967296]
expected: FAIL
[th.colSpan: setAttribute() to "-0"]
expected: FAIL
[th.colSpan: setAttribute() to "0"]
expected: FAIL
[th.colSpan: setAttribute() to 1001]
expected: FAIL
@ -9995,60 +9623,12 @@
[colgroup.tabIndex: setAttribute() to object "3"]
expected: FAIL
[colgroup.span: setAttribute() to "-"]
expected: FAIL
[colgroup.span: setAttribute() to "+"]
expected: FAIL
[colgroup.span: setAttribute() to "\\t\\v7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\n\\v7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\f\\v7"]
expected: FAIL
[colgroup.span: setAttribute() to "\\r\\v7"]
expected: FAIL
[colgroup.span: setAttribute() to " \\v7"]
expected: FAIL
[colgroup.span: setAttribute() to "7\\v"]
expected: FAIL
[col.tabIndex: setAttribute() to "7\\v"]
expected: FAIL
[col.tabIndex: setAttribute() to object "3"]
expected: FAIL
[col.span: setAttribute() to "-"]
expected: FAIL
[col.span: setAttribute() to "+"]
expected: FAIL
[col.span: setAttribute() to "\\t\\v7"]
expected: FAIL
[col.span: setAttribute() to "\\n\\v7"]
expected: FAIL
[col.span: setAttribute() to "\\f\\v7"]
expected: FAIL
[col.span: setAttribute() to "\\r\\v7"]
expected: FAIL
[col.span: setAttribute() to " \\v7"]
expected: FAIL
[col.span: setAttribute() to "7\\v"]
expected: FAIL
[tbody.tabIndex: setAttribute() to "7\\v"]
expected: FAIL