From b69036970b8513bd88c18e9679aa394552c17525 Mon Sep 17 00:00:00 2001 From: Andi Gallo Date: Fri, 16 Jun 2023 02:48:56 +0000 Subject: [PATCH] LibWeb: Add layout support for border spacing When border-collapse is separate, border-spacing affects layout. Implement most of that functionality. --- ...y-layout-internal-box-without-crashing.txt | 12 +- ...ot-be-affected-by-presentational-hints.txt | 18 +-- Tests/LibWeb/Layout/expected/table/basic.txt | 42 ++--- .../expected/table/border-spacing-colspan.txt | 141 +++++++++++++++++ .../expected/table/border-spacing-rowspan.txt | 141 +++++++++++++++++ .../Layout/expected/table/border-spacing.txt | 148 ++++++++++++++++++ .../LibWeb/Layout/expected/table/borders.txt | 148 +++++++++--------- .../Layout/expected/table/bottom-caption.txt | 32 ++-- .../table/columns-width-distribution-1.txt | 26 +-- .../expected/table/inline-table-width.txt | 32 ++-- .../table/long-caption-increases-width.txt | 55 +++---- .../table/row-span-and-nested-tables.txt | 54 +++---- .../LibWeb/Layout/expected/table/rowspan.txt | 62 ++++---- .../Layout/expected/table/table-width.txt | 10 +- .../input/table/border-spacing-colspan.html | 64 ++++++++ .../input/table/border-spacing-rowspan.html | 64 ++++++++ .../Layout/input/table/border-spacing.html | 65 ++++++++ .../LibWeb/Layout/TableFormattingContext.cpp | 89 +++++++++-- .../LibWeb/Layout/TableFormattingContext.h | 5 + 19 files changed, 949 insertions(+), 259 deletions(-) create mode 100644 Tests/LibWeb/Layout/expected/table/border-spacing-colspan.txt create mode 100644 Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt create mode 100644 Tests/LibWeb/Layout/expected/table/border-spacing.txt create mode 100644 Tests/LibWeb/Layout/input/table/border-spacing-colspan.html create mode 100644 Tests/LibWeb/Layout/input/table/border-spacing-rowspan.html create mode 100644 Tests/LibWeb/Layout/input/table/border-spacing.html diff --git a/Tests/LibWeb/Layout/expected/blockify-layout-internal-box-without-crashing.txt b/Tests/LibWeb/Layout/expected/blockify-layout-internal-box-without-crashing.txt index dc041625cd..05cb1138e5 100644 --- a/Tests/LibWeb/Layout/expected/blockify-layout-internal-box-without-crashing.txt +++ b/Tests/LibWeb/Layout/expected/blockify-layout-internal-box-without-crashing.txt @@ -1,9 +1,9 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (0,0) content-size 800x16 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x0 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 0x0 [BFC] children: not-inline - Box at (8,8) content-size 0x0 table-box [TFC] children: not-inline + BlockContainer at (0,0) content-size 800x20 [BFC] children: not-inline + BlockContainer at (8,8) content-size 784x4 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 4x4 [BFC] children: not-inline + Box
at (8,8) content-size 4x4 table-box [TFC] children: not-inline Box at (8,8) content-size 0x0 table-row-group children: not-inline - Box at (8,8) content-size 0x0 table-row children: not-inline - BlockContainer <(anonymous)> at (8,8) content-size 0x0 table-cell [BFC] children: not-inline + Box at (10,10) content-size 0x0 table-row children: not-inline + BlockContainer <(anonymous)> at (10,10) content-size 0x0 table-cell [BFC] children: not-inline BlockContainer
at (9,9) content-size 0x0 positioned [BFC] children: not-inline diff --git a/Tests/LibWeb/Layout/expected/css-pseudo-element-should-not-be-affected-by-presentational-hints.txt b/Tests/LibWeb/Layout/expected/css-pseudo-element-should-not-be-affected-by-presentational-hints.txt index 8cc5bcac74..73f07ba0c7 100644 --- a/Tests/LibWeb/Layout/expected/css-pseudo-element-should-not-be-affected-by-presentational-hints.txt +++ b/Tests/LibWeb/Layout/expected/css-pseudo-element-should-not-be-affected-by-presentational-hints.txt @@ -1,13 +1,13 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (1,1) content-size 798x120 [BFC] children: not-inline - BlockContainer at (10,10) content-size 780x102 children: not-inline - TableWrapper <(anonymous)> at (10,10) content-size 102x102 [BFC] children: not-inline - Box at (11,11) content-size 100x100 table-box [TFC] children: not-inline - Box at (11,11) content-size 100x100 table-row-group children: not-inline - Box at (11,11) content-size 100x100 table-row children: not-inline - BlockContainer
at (13,49.082031) content-size 96x23.835937 table-cell [BFC] children: not-inline - BlockContainer <(anonymous)> at (14,50.082031) content-size 94x21.835937 children: inline + BlockContainer at (1,1) content-size 798x124 [BFC] children: not-inline + BlockContainer at (10,10) content-size 780x106 children: not-inline + TableWrapper <(anonymous)> at (10,10) content-size 106x106 [BFC] children: not-inline + Box at (11,11) content-size 106x104 table-box [TFC] children: not-inline + Box at (11,11) content-size 102x100 table-row-group children: not-inline + Box at (13,13) content-size 102x100 table-row children: not-inline + BlockContainer at (8,8) content-size 95.171875x19.46875 table-header-group children: not-inline + Box at (8,10) content-size 95.171875x19.46875 table-header-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,25.46875) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,29.46875) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,27.46875) content-size 95.171875x19.46875 table-row-group children: not-inline + Box at (8,29.46875) content-size 95.171875x19.46875 table-row-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,44.9375) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,48.9375) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,46.9375) content-size 95.171875x19.46875 table-footer-group children: not-inline + Box at (8,48.9375) content-size 95.171875x19.46875 table-footer-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,64.40625) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,68.40625) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (15,51.082031) content-size 98x23.835937 table-cell [BFC] children: not-inline + BlockContainer <(anonymous)> at (16,52.082031) content-size 96x21.835937 children: inline line 0 width: 0, height: 21.835937, bottom: 21.835937, baseline: 16.914062 - frag 0 from TextNode start: 0, length: 0, rect: [14,50.082031 0x21.835937] + frag 0 from TextNode start: 0, length: 0, rect: [16,52.082031 0x21.835937] "" TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/basic.txt b/Tests/LibWeb/Layout/expected/table/basic.txt index 81a51724c4..7cbf121a06 100644 --- a/Tests/LibWeb/Layout/expected/table/basic.txt +++ b/Tests/LibWeb/Layout/expected/table/basic.txt @@ -1,31 +1,31 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x75.875 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 0x0 [BFC] children: not-inline - Box at (8,8) content-size 0x0 table-box [TFC] children: not-inline - BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + BlockContainer at (8,8) content-size 784x85.875 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 2x2 [BFC] children: not-inline + Box at (8,8) content-size 2x2 table-box [TFC] children: not-inline + BlockContainer <(anonymous)> at (8,10) content-size 784x0 children: inline TextNode <#text> TextNode <#text> - TableWrapper <(anonymous)> at (8,8) content-size 95.171875x75.875 [BFC] children: not-inline - Box at (8,25.46875) content-size 95.171875x58.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,10) content-size 99.171875x83.875 [BFC] children: not-inline + Box at (8,27.46875) content-size 99.171875x66.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (8,8) content-size 82.734375x17.46875 [BFC] children: inline + BlockContainer at (8,10) content-size 82.734375x17.46875 [BFC] children: inline line 0 width: 82.734375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 1, length: 9, rect: [14,8 82.734375x17.46875] + frag 0 from TextNode start: 1, length: 9, rect: [16,10 82.734375x17.46875] "A Caption" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,26.46875) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,30.46875) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 73.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [9,26.46875 73.65625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [11,30.46875 73.65625x17.46875] "Head Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -34,15 +34,15 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,45.9375) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,51.9375) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 70.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [9,45.9375 70.234375x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [11,51.9375 70.234375x17.46875] "Body Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -51,15 +51,15 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,65.40625) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,73.40625) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 93.171875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 11, rect: [9,65.40625 93.171875x17.46875] + frag 0 from TextNode start: 0, length: 11, rect: [11,73.40625 93.171875x17.46875] "Footer Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -68,5 +68,5 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,83.875) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,93.875) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/border-spacing-colspan.txt b/Tests/LibWeb/Layout/expected/table/border-spacing-colspan.txt new file mode 100644 index 0000000000..04b678b776 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/border-spacing-colspan.txt @@ -0,0 +1,141 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x275.34375 [BFC] children: not-inline + BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x259.34375 children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (8,8) content-size 241.625x259.34375 [BFC] children: not-inline + Box at (9,9) content-size 241.625x257.34375 table-box [TFC] children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (9,9) content-size 163.625x197.34375 table-row-group children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (29,19) content-size 163.625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,58.46875) content-size 163.625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,97.9375) content-size 163.625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,137.40625) content-size 163.625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,176.875) content-size 163.625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer
at (50,30) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [50,30 14.265625x17.46875] + "A" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,30) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [128.265625,30 9.34375x17.46875] + "B" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (202.53125,30) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [203.53125,30 6.34375x17.46875] + "1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,79.46875) content-size 90.53125x17.46875 table-cell [BFC] children: inline + line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [90,79.46875 10.3125x17.46875] + "C" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (202.53125,79.46875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [202.53125,79.46875 8.8125x17.46875] + "2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,128.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,128.9375 11.859375x17.46875] + "E" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,128.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [127.265625,128.9375 12.546875x17.46875] + "F" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (202.53125,128.9375) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [202.53125,128.9375 9.09375x17.46875] + "3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,178.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 13.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,178.40625 13.234375x17.46875] + "G" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,178.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 12.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [127.265625,178.40625 12.234375x17.46875] + "H" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (202.53125,178.40625) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [203.53125,178.40625 7.75x17.46875] + "4" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,227.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 4.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [55,227.875 4.59375x17.46875] + "I" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,227.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 8.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [129.265625,227.875 8.90625x17.46875] + "J" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (202.53125,227.875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [202.53125,227.875 8.453125x17.46875] + "5" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (8,267.34375) content-size 784x0 children: inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt b/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt new file mode 100644 index 0000000000..2c30f34c10 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt @@ -0,0 +1,141 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x275.34375 [BFC] children: not-inline + BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x259.34375 children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (8,8) content-size 239.90625x259.34375 [BFC] children: not-inline + Box at (9,9) content-size 239.90625x257.34375 table-box [TFC] children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (9,9) content-size 161.90625x197.34375 table-row-group children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (29,19) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,58.46875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,97.9375) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,137.40625) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,176.875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer
at (50,54.734375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [50,54.734375 14.265625x17.46875] + "A" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,30) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [128.265625,30 9.34375x17.46875] + "B" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,30) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [201.8125,30 6.34375x17.46875] + "1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (126.265625,79.46875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 11.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [127.265625,79.46875 11.140625x17.46875] + "D" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,79.46875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,79.46875 8.8125x17.46875] + "2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,128.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,128.9375 11.859375x17.46875] + "E" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,128.9375) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [126.265625,128.9375 12.546875x17.46875] + "F" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,128.9375) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,128.9375 9.09375x17.46875] + "3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,178.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 13.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,178.40625 13.234375x17.46875] + "G" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,178.40625) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [126.265625,178.40625 12.234375x17.46875] + "H" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,178.40625) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [201.8125,178.40625 7.75x17.46875] + "4" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,227.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 4.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [55,227.875 4.59375x17.46875] + "I" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,227.875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 8.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [128.265625,227.875 8.90625x17.46875] + "J" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,227.875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,227.875 8.453125x17.46875] + "5" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (8,267.34375) content-size 784x0 children: inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/border-spacing.txt b/Tests/LibWeb/Layout/expected/table/border-spacing.txt new file mode 100644 index 0000000000..8eae206e9b --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/border-spacing.txt @@ -0,0 +1,148 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x275.34375 [BFC] children: not-inline + BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x259.34375 children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (8,8) content-size 239.90625x259.34375 [BFC] children: not-inline + Box at (9,9) content-size 239.90625x257.34375 table-box [TFC] children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (9,9) content-size 161.90625x197.34375 table-row-group children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (29,19) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,58.46875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,97.9375) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,137.40625) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (29,176.875) content-size 161.90625x39.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,9) content-size 166.296875x64.40625 table-row-group children: not-inline - Box at (9,9) content-size 166.296875x21.46875 table-row children: not-inline + Box at (11,11) content-size 166.296875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (9,30.46875) content-size 166.296875x21.46875 table-row children: not-inline + Box at (11,32.46875) content-size 166.296875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (9,51.9375) content-size 166.296875x21.46875 table-row children: not-inline + Box at (11,53.9375) content-size 166.296875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,74.40625) content-size 164.296875x62.40625 table-row-group children: not-inline - Box at (8,74.40625) content-size 164.296875x20.46875 table-row children: not-inline + Box at (8,82.40625) content-size 164.296875x62.40625 table-row-group children: not-inline + Box at (8,82.40625) content-size 164.296875x20.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,94.875) content-size 164.296875x21.46875 table-row children: not-inline + Box at (8,102.875) content-size 164.296875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,116.34375) content-size 164.296875x20.46875 table-row children: not-inline + Box at (8,124.34375) content-size 164.296875x20.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,8) content-size 95.171875x19.46875 table-header-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,8) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,10) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,27.46875) content-size 95.171875x19.46875 table-row-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,27.46875) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,29.46875) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,46.9375) content-size 95.171875x19.46875 table-footer-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,46.9375) content-size 95.171875x19.46875 table-row children: not-inline + Box at (10,48.9375) content-size 95.171875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (9,9) content-size 780x90.21875 table-row-group children: not-inline - Box at (9,9) content-size 780x90.21875 table-row children: not-inline - BlockContainer at (10,29.109375) content-size 50x50 table-cell [BFC] children: not-inline - BlockContainer at (10,29.109375) content-size 50x50 children: not-inline - BlockContainer at (62,10) content-size 726x88.21875 table-cell [BFC] children: inline + Box at (9,9) content-size 782x90.21875 table-row-group children: not-inline + Box at (11,11) content-size 782x90.21875 table-row children: not-inline + BlockContainer at (12,31.109375) content-size 50x50 table-cell [BFC] children: not-inline + BlockContainer at (12,31.109375) content-size 50x50 children: not-inline + BlockContainer at (66,12) content-size 728x88.21875 table-cell [BFC] children: inline line 0 width: 689.640625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 1, length: 84, rect: [62,10 689.640625x17.46875] + frag 0 from TextNode start: 1, length: 84, rect: [66,12 689.640625x17.46875] "In a scene set in a lawyer's office, the lawyer sits alone and bounces a rubber ball" line 1 width: 695.5625, height: 17.9375, bottom: 35.40625, baseline: 13.53125 - frag 0 from TextNode start: 86, length: 84, rect: [62,27 695.5625x17.46875] + frag 0 from TextNode start: 86, length: 84, rect: [66,29 695.5625x17.46875] "against the wall. They receive a call from their assistant who expresses frustration" line 2 width: 703.125, height: 18.40625, bottom: 53.34375, baseline: 13.53125 - frag 0 from TextNode start: 171, length: 85, rect: [62,44 703.125x17.46875] + frag 0 from TextNode start: 171, length: 85, rect: [66,46 703.125x17.46875] "over a packed waiting room and the lawyer's lack of clients. The lawyer then looks at" line 3 width: 695.90625, height: 17.875, bottom: 70.28125, baseline: 13.53125 - frag 0 from TextNode start: 257, length: 81, rect: [62,62 695.90625x17.46875] + frag 0 from TextNode start: 257, length: 81, rect: [66,64 695.90625x17.46875] "some papers from a large envelope, which turn out to be divorce papers from their" line 4 width: 725.734375, height: 18.34375, bottom: 88.21875, baseline: 13.53125 - frag 0 from TextNode start: 339, length: 92, rect: [62,79 725.734375x17.46875] + frag 0 from TextNode start: 339, length: 92, rect: [66,81 725.734375x17.46875] "significant other. Finally, the lawyer instructs their assistant to send in the next client." TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/inline-table-width.txt b/Tests/LibWeb/Layout/expected/table/inline-table-width.txt index 45576b0e3a..2fdfe37c0a 100644 --- a/Tests/LibWeb/Layout/expected/table/inline-table-width.txt +++ b/Tests/LibWeb/Layout/expected/table/inline-table-width.txt @@ -1,31 +1,31 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x40.9375 children: inline - line 0 width: 131.984375, height: 40.9375, bottom: 40.9375, baseline: 35 - frag 0 from BlockContainer start: 0, length: 0, rect: [9,9 129.984375x38.9375] - BlockContainer
at (50,30) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [50,30 14.265625x17.46875] + "A" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,30) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [128.265625,30 9.34375x17.46875] + "B" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,30) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 6.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [201.8125,30 6.34375x17.46875] + "1" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,79.46875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [52,79.46875 10.3125x17.46875] + "C" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,79.46875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 11.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [127.265625,79.46875 11.140625x17.46875] + "D" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,79.46875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.8125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,79.46875 8.8125x17.46875] + "2" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,128.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,128.9375 11.859375x17.46875] + "E" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,128.9375) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [126.265625,128.9375 12.546875x17.46875] + "F" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,128.9375) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 9.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,128.9375 9.09375x17.46875] + "3" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,178.40625) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 13.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [51,178.40625 13.234375x17.46875] + "G" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,178.40625) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 12.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [126.265625,178.40625 12.234375x17.46875] + "H" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,178.40625) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 7.75, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [201.8125,178.40625 7.75x17.46875] + "4" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (50,227.875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + line 0 width: 4.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [55,227.875 4.59375x17.46875] + "I" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (126.265625,227.875) content-size 12.546875x17.46875 table-cell [BFC] children: inline + line 0 width: 8.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [128.265625,227.875 8.90625x17.46875] + "J" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (200.8125,227.875) content-size 9.09375x17.46875 table-cell [BFC] children: inline + line 0 width: 8.453125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [200.8125,227.875 8.453125x17.46875] + "5" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (8,267.34375) content-size 784x0 children: inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/borders.txt b/Tests/LibWeb/Layout/expected/table/borders.txt index 32c7d888d2..86b5370a99 100644 --- a/Tests/LibWeb/Layout/expected/table/borders.txt +++ b/Tests/LibWeb/Layout/expected/table/borders.txt @@ -1,260 +1,260 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x277.625 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 164.296875x66.40625 [BFC] children: not-inline - Box at (9,9) content-size 164.296875x64.40625 table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x285.625 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 170.296875x74.40625 [BFC] children: not-inline + Box at (9,9) content-size 170.296875x72.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> Box
at (11,11) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (13,13) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 82.015625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [11,11 82.015625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [13,13 82.015625x17.46875] "Firstname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (97.015625,11) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (101.015625,13) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 76.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [97.015625,11 76.28125x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [101.015625,13 76.28125x17.46875] "Lastname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (11,32.46875) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (13,36.46875) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 44.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [11,32.46875 44.65625x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [13,36.46875 44.65625x17.46875] "Peter" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (97.015625,32.46875) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (101.015625,36.46875) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [97.015625,32.46875 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [101.015625,36.46875 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (11,53.9375) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (13,59.9375) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 35.125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 4, rect: [11,53.9375 35.125x17.46875] + frag 0 from TextNode start: 0, length: 4, rect: [13,59.9375 35.125x17.46875] "Lois" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (97.015625,53.9375) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (101.015625,59.9375) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [97.015625,53.9375 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [101.015625,59.9375 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,74.40625) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,82.40625) content-size 784x0 children: inline TextNode <#text> TextNode <#text> - TableWrapper <(anonymous)> at (8,74.40625) content-size 164.296875x62.40625 [BFC] children: not-inline - Box at (8,74.40625) content-size 164.296875x62.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,82.40625) content-size 164.296875x62.40625 [BFC] children: not-inline + Box at (8,82.40625) content-size 164.296875x62.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,75.40625) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (9,83.40625) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 82.015625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [9,75.40625 82.015625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [9,83.40625 82.015625x17.46875] "Firstname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (95.015625,75.40625) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (95.015625,83.40625) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 76.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [95.015625,75.40625 76.28125x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [95.015625,83.40625 76.28125x17.46875] "Lastname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,96.875) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (9,104.875) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 44.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [9,96.875 44.65625x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [9,104.875 44.65625x17.46875] "Peter" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (95.015625,96.875) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (95.015625,104.875) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [95.015625,96.875 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [95.015625,104.875 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,118.34375) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (9,126.34375) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 35.125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 4, rect: [9,118.34375 35.125x17.46875] + frag 0 from TextNode start: 0, length: 4, rect: [9,126.34375 35.125x17.46875] "Lois" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (95.015625,118.34375) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (95.015625,126.34375) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [95.015625,118.34375 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [95.015625,126.34375 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,136.8125) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,144.8125) content-size 784x0 children: inline TextNode <#text> TextNode <#text> - TableWrapper <(anonymous)> at (8,136.8125) content-size 160.296875x56.40625 [BFC] children: not-inline - Box at (8,136.8125) content-size 160.296875x56.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,144.8125) content-size 160.296875x56.40625 [BFC] children: not-inline + Box at (8,144.8125) content-size 160.296875x56.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,136.8125) content-size 160.296875x18.46875 table-row children: not-inline + Box at (8,144.8125) content-size 160.296875x18.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,136.8125) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,144.8125) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 82.015625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [8,136.8125 82.015625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [8,144.8125 82.015625x17.46875] "Firstname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (92.015625,136.8125) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (92.015625,144.8125) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 76.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [92.015625,136.8125 76.28125x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [92.015625,144.8125 76.28125x17.46875] "Lastname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,155.28125) content-size 160.296875x19.46875 table-row children: not-inline + Box at (8,163.28125) content-size 160.296875x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,156.28125) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,164.28125) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 44.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [8,156.28125 44.65625x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [8,164.28125 44.65625x17.46875] "Peter" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (92.015625,156.28125) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (92.015625,164.28125) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [92.015625,156.28125 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [92.015625,164.28125 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,174.75) content-size 160.296875x18.46875 table-row children: not-inline + Box at (8,182.75) content-size 160.296875x18.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,175.75) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,183.75) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 35.125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 4, rect: [8,175.75 35.125x17.46875] + frag 0 from TextNode start: 0, length: 4, rect: [8,183.75 35.125x17.46875] "Lois" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (92.015625,175.75) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (92.015625,183.75) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [92.015625,175.75 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [92.015625,183.75 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,193.21875) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,201.21875) content-size 784x0 children: inline TextNode <#text> TextNode <#text> - TableWrapper <(anonymous)> at (8,193.21875) content-size 178.296875x92.40625 [BFC] children: not-inline - Box at (8,193.21875) content-size 178.296875x92.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,201.21875) content-size 178.296875x92.40625 [BFC] children: not-inline + Box at (8,201.21875) content-size 178.296875x92.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,193.21875) content-size 178.296875x27.46875 table-row children: not-inline + Box at (8,201.21875) content-size 178.296875x27.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,193.21875) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,201.21875) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 82.015625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [8,193.21875 82.015625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [8,201.21875 82.015625x17.46875] "Firstname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (110.015625,193.21875) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (110.015625,201.21875) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 76.28125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [110.015625,193.21875 76.28125x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [110.015625,201.21875 76.28125x17.46875] "Lastname" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,220.6875) content-size 178.296875x37.46875 table-row children: not-inline + Box at (8,228.6875) content-size 178.296875x37.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,230.6875) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,238.6875) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 44.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [8,230.6875 44.65625x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [8,238.6875 44.65625x17.46875] "Peter" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (110.015625,230.6875) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (110.015625,238.6875) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [110.015625,230.6875 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [110.015625,238.6875 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (8,258.15625) content-size 178.296875x27.46875 table-row children: not-inline + Box at (8,266.15625) content-size 178.296875x27.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,268.15625) content-size 82.015625x17.46875 table-cell [BFC] children: inline + BlockContainer at (8,276.15625) content-size 82.015625x17.46875 table-cell [BFC] children: inline line 0 width: 35.125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 4, rect: [8,268.15625 35.125x17.46875] + frag 0 from TextNode start: 0, length: 4, rect: [8,276.15625 35.125x17.46875] "Lois" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (110.015625,268.15625) content-size 76.28125x17.46875 table-cell [BFC] children: inline + BlockContainer at (110.015625,276.15625) content-size 76.28125x17.46875 table-cell [BFC] children: inline line 0 width: 53.671875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 7, rect: [110.015625,268.15625 53.671875x17.46875] + frag 0 from TextNode start: 0, length: 7, rect: [110.015625,276.15625 53.671875x17.46875] "Griffin" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,285.625) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,293.625) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/bottom-caption.txt b/Tests/LibWeb/Layout/expected/table/bottom-caption.txt index 0d08931822..7380e2ac8d 100644 --- a/Tests/LibWeb/Layout/expected/table/bottom-caption.txt +++ b/Tests/LibWeb/Layout/expected/table/bottom-caption.txt @@ -1,15 +1,15 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (0,0) content-size 800x91.875 [BFC] children: not-inline + BlockContainer at (0,0) content-size 800x99.875 [BFC] children: not-inline BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline TextNode <#text> - BlockContainer at (8,8) content-size 784x75.875 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 95.171875x75.875 [BFC] children: not-inline - Box at (8,8) content-size 95.171875x58.40625 table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x83.875 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 99.171875x83.875 [BFC] children: not-inline + Box at (8,8) content-size 99.171875x66.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (8,66.40625) content-size 82.734375x17.46875 [BFC] children: inline + BlockContainer at (8,74.40625) content-size 82.734375x17.46875 [BFC] children: inline line 0 width: 82.734375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 1, length: 9, rect: [14,66.40625 82.734375x17.46875] + frag 0 from TextNode start: 1, length: 9, rect: [16,74.40625 82.734375x17.46875] "A Caption" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -17,12 +17,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (9,9) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,11) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 73.65625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [9,9 73.65625x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [11,11 73.65625x17.46875] "Head Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -34,12 +34,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (9,28.46875) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,32.46875) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 70.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 9, rect: [9,28.46875 70.234375x17.46875] + frag 0 from TextNode start: 0, length: 9, rect: [11,32.46875 70.234375x17.46875] "Body Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -51,12 +51,12 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (9,47.9375) content-size 93.171875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,53.9375) content-size 93.171875x17.46875 table-cell [BFC] children: inline line 0 width: 93.171875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 11, rect: [9,47.9375 93.171875x17.46875] + frag 0 from TextNode start: 0, length: 11, rect: [11,53.9375 93.171875x17.46875] "Footer Cell" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -65,5 +65,5 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,83.875) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,91.875) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt b/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt index a214ce2759..96eb89661c 100644 --- a/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt +++ b/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt @@ -1,28 +1,28 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x92.21875 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 782x92.21875 [BFC] children: not-inline - Box at (9,9) content-size 780x90.21875 table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x96.21875 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 784x96.21875 [BFC] children: not-inline + Box at (9,9) content-size 788x94.21875 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,9) content-size 129.984375x38.9375 inline-block [BFC] children: not-inline - TableWrapper <(anonymous)> at (9,9) content-size 129.984375x38.9375 inline-block [BFC] children: not-inline - Box <(anonymous)> at (9,9) content-size 129.984375x38.9375 inline-table table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x46.9375 children: inline + line 0 width: 131.984375, height: 46.9375, bottom: 46.9375, baseline: 39 + frag 0 from BlockContainer start: 0, length: 0, rect: [9,9 129.984375x44.9375] + BlockContainer
at (9,9) content-size 129.984375x44.9375 inline-block [BFC] children: not-inline + TableWrapper <(anonymous)> at (9,9) content-size 129.984375x44.9375 inline-block [BFC] children: not-inline + Box <(anonymous)> at (9,9) content-size 135.984375x44.9375 inline-table table-box [TFC] children: not-inline Box at (9,9) content-size 129.984375x38.9375 table-row-group children: not-inline - Box at (9,9) content-size 129.984375x19.46875 table-row children: not-inline - BlockContainer at (11,11) content-size 129.984375x19.46875 table-row children: not-inline + BlockContainer at (9,28.46875) content-size 129.984375x19.46875 table-row children: not-inline - BlockContainer at (11,30.46875) content-size 129.984375x19.46875 table-row children: not-inline + BlockContainer at (10,10) content-size 55.046875x21.46875 table-header-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (10,61.8125) content-size 55.046875x21.46875 table-row children: not-inline + Box at (12,45.40625) content-size 55.046875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (10,31.46875) content-size 55.046875x21.46875 table-row-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (10,83.28125) content-size 55.046875x21.46875 table-row children: not-inline + Box at (12,66.875) content-size 55.046875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (10,52.9375) content-size 55.046875x21.46875 table-footer-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (10,104.75) content-size 55.046875x21.46875 table-row children: not-inline + Box at (12,88.34375) content-size 55.046875x21.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (10,10) content-size 87.90625x17.46875 table-cell [BFC] children: inline + Box
at (12,12) content-size 87.90625x17.46875 table-cell [BFC] children: inline line 0 width: 15.734375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [10,10 15.734375x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [12,12 15.734375x17.46875] "ID" TextNode <#text> - BlockContainer at (99.90625,10) content-size 38.078125x17.46875 table-cell [BFC] children: inline + BlockContainer at (103.90625,12) content-size 38.078125x17.46875 table-cell [BFC] children: inline line 0 width: 27.84375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 4, rect: [99.90625,10 27.84375x17.46875] + frag 0 from TextNode start: 0, length: 4, rect: [103.90625,12 27.84375x17.46875] "null" TextNode <#text> - Box
at (10,29.46875) content-size 87.90625x17.46875 table-cell [BFC] children: inline + Box
at (12,33.46875) content-size 87.90625x17.46875 table-cell [BFC] children: inline line 0 width: 87.90625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 11, rect: [10,29.46875 87.90625x17.46875] + frag 0 from TextNode start: 0, length: 11, rect: [12,33.46875 87.90625x17.46875] "Is Selected" TextNode <#text> - BlockContainer at (99.90625,29.46875) content-size 38.078125x17.46875 table-cell [BFC] children: inline + BlockContainer at (103.90625,33.46875) content-size 38.078125x17.46875 table-cell [BFC] children: inline line 0 width: 38.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [99.90625,29.46875 38.078125x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [103.90625,33.46875 38.078125x17.46875] "false" TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/long-caption-increases-width.txt b/Tests/LibWeb/Layout/expected/table/long-caption-increases-width.txt index b16d3040cb..2107dc4f52 100644 --- a/Tests/LibWeb/Layout/expected/table/long-caption-increases-width.txt +++ b/Tests/LibWeb/Layout/expected/table/long-caption-increases-width.txt @@ -1,21 +1,18 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (0,0) content-size 800x138.21875 [BFC] children: not-inline + BlockContainer at (0,0) content-size 800x127.8125 [BFC] children: not-inline BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline TextNode <#text> - BlockContainer at (8,8) content-size 784x122.21875 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 55.046875x122.21875 [BFC] children: not-inline - Box at (10,61.8125) content-size 55.046875x64.40625 table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x111.8125 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 61.046875x111.8125 [BFC] children: not-inline + Box at (10,43.40625) content-size 61.046875x72.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (8,8) content-size 59.046875x53.8125 [BFC] children: inline - line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 1, length: 1, rect: [22,8 14.265625x17.46875] - "A" - line 1 width: 31.765625, height: 17.9375, bottom: 35.40625, baseline: 13.53125 - frag 0 from TextNode start: 3, length: 4, rect: [14,25 31.765625x17.46875] - "long" - line 2 width: 59.046875, height: 18.40625, bottom: 53.34375, baseline: 13.53125 - frag 0 from TextNode start: 8, length: 7, rect: [8,42 59.046875x17.46875] + BlockContainer at (8,8) content-size 59.046875x35.40625 [BFC] children: inline + line 0 width: 54.03125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 1, length: 6, rect: [10,8 54.03125x17.46875] + "A long" + line 1 width: 59.046875, height: 17.9375, bottom: 35.40625, baseline: 13.53125 + frag 0 from TextNode start: 8, length: 7, rect: [8,25 59.046875x17.46875] "caption" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -23,19 +20,19 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (12,63.8125) content-size 22.208835x17.46875 table-cell [BFC] children: inline + BlockContainer at (14,47.40625) content-size 22.208835x17.46875 table-cell [BFC] children: inline line 0 width: 20.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [12,63.8125 20.609375x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [14,47.40625 20.609375x17.46875] "A1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (38.208835,63.8125) content-size 24.838039x17.46875 table-cell [BFC] children: inline + BlockContainer at (42.208835,47.40625) content-size 24.838039x17.46875 table-cell [BFC] children: inline line 0 width: 23.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [38.208835,63.8125 23.078125x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [42.208835,47.40625 23.078125x17.46875] "A2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -47,19 +44,19 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (12,85.28125) content-size 22.208835x17.46875 table-cell [BFC] children: inline + BlockContainer at (14,70.875) content-size 22.208835x17.46875 table-cell [BFC] children: inline line 0 width: 15.6875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [12,85.28125 15.6875x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [14,70.875 15.6875x17.46875] "B1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (38.208835,85.28125) content-size 24.838039x17.46875 table-cell [BFC] children: inline + BlockContainer at (42.208835,70.875) content-size 24.838039x17.46875 table-cell [BFC] children: inline line 0 width: 18.15625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [38.208835,85.28125 18.15625x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [42.208835,70.875 18.15625x17.46875] "B2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -71,19 +68,19 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline Box
at (12,106.75) content-size 22.208835x17.46875 table-cell [BFC] children: inline + BlockContainer at (14,94.34375) content-size 22.208835x17.46875 table-cell [BFC] children: inline line 0 width: 18.890625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [12,106.75 18.890625x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [14,94.34375 18.890625x17.46875] "F1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (38.208835,106.75) content-size 24.838039x17.46875 table-cell [BFC] children: inline + BlockContainer at (42.208835,94.34375) content-size 24.838039x17.46875 table-cell [BFC] children: inline line 0 width: 21.359375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 2, rect: [38.208835,106.75 21.359375x17.46875] + frag 0 from TextNode start: 0, length: 2, rect: [42.208835,94.34375 21.359375x17.46875] "F2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -92,5 +89,5 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,130.21875) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,119.8125) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt b/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt index 3e4579bca2..363e9e0ea8 100644 --- a/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt +++ b/Tests/LibWeb/Layout/expected/table/row-span-and-nested-tables.txt @@ -1,67 +1,67 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (0,0) content-size 800x120.40625 [BFC] children: not-inline + BlockContainer at (0,0) content-size 800x132.40625 [BFC] children: not-inline BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline TextNode <#text> - BlockContainer at (8,8) content-size 784x104.40625 children: not-inline + BlockContainer at (8,8) content-size 784x116.40625 children: not-inline BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline TextNode <#text> - TableWrapper <(anonymous)> at (8,8) content-size 59.828125x104.40625 [BFC] children: not-inline - Box at (9,9) content-size 57.828125x102.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 65.828125x116.40625 [BFC] children: not-inline + Box
at (9,9) content-size 65.828125x114.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (9,9) content-size 57.828125x102.40625 table-row-group children: not-inline + Box at (9,9) content-size 59.828125x108.40625 table-row-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (9,9) content-size 57.828125x51.203125 table-row children: not-inline + Box at (11,11) content-size 59.828125x54.203125 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (15,25.867187) content-size 11.5625x17.46875 table-cell [BFC] children: inline + BlockContainer at (17,29.367187) content-size 11.5625x17.46875 table-cell [BFC] children: inline line 0 width: 11.5625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 1, rect: [15,25.867187 11.5625x17.46875] + frag 0 from TextNode start: 0, length: 1, rect: [17,29.367187 11.5625x17.46875] "X" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (38.5625,15) content-size 22.265625x90.40625 table-cell [BFC] children: not-inline - BlockContainer <(anonymous)> at (38.5625,15) content-size 22.265625x0 children: inline + BlockContainer at (42.5625,17) content-size 24.265625x98.40625 table-cell [BFC] children: not-inline + BlockContainer <(anonymous)> at (42.5625,17) content-size 24.265625x0 children: inline TextNode <#text> - TableWrapper <(anonymous)> at (38.5625,15) content-size 22.265625x90.40625 [BFC] children: not-inline - Box at (39.5625,16) content-size 24.265625x88.40625 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (42.5625,17) content-size 24.265625x98.40625 [BFC] children: not-inline + Box
at (43.5625,18) content-size 28.265625x96.40625 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (39.5625,16) content-size 26.265625x88.40625 table-row-group children: not-inline + Box at (43.5625,18) content-size 26.265625x88.40625 table-row-group children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box at (39.5625,16) content-size 26.265625x29.46875 table-row children: not-inline + Box at (45.5625,20) content-size 26.265625x29.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (39.5625,45.46875) content-size 26.265625x29.46875 table-row children: not-inline + Box at (45.5625,49.46875) content-size 26.265625x29.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (39.5625,74.9375) content-size 26.265625x29.46875 table-row children: not-inline + Box at (45.5625,78.9375) content-size 26.265625x29.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (9,60.203125) content-size 57.828125x51.203125 table-row children: not-inline + Box at (11,65.203125) content-size 59.828125x54.203125 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer
at (45.5625,22) content-size 14.265625x17.46875 table-cell [BFC] children: inline + BlockContainer at (51.5625,26) content-size 14.265625x17.46875 table-cell [BFC] children: inline line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 1, rect: [45.5625,22 14.265625x17.46875] + frag 0 from TextNode start: 0, length: 1, rect: [51.5625,26 14.265625x17.46875] "A" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (45.5625,51.46875) content-size 14.265625x17.46875 table-cell [BFC] children: inline + BlockContainer at (51.5625,57.46875) content-size 14.265625x17.46875 table-cell [BFC] children: inline line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 1, rect: [45.5625,51.46875 9.34375x17.46875] + frag 0 from TextNode start: 0, length: 1, rect: [51.5625,57.46875 9.34375x17.46875] "B" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (45.5625,80.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline + BlockContainer at (51.5625,88.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 1, rect: [45.5625,80.9375 10.3125x17.46875] + frag 0 from TextNode start: 0, length: 1, rect: [51.5625,88.9375 10.3125x17.46875] "C" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -70,18 +70,18 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (38.5625,105.40625) content-size 22.265625x0 children: inline + BlockContainer <(anonymous)> at (42.5625,115.40625) content-size 24.265625x0 children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (15,77.070312) content-size 11.5625x17.46875 table-cell [BFC] children: inline + BlockContainer at (17,85.570312) content-size 11.5625x17.46875 table-cell [BFC] children: inline line 0 width: 11.09375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 1, rect: [15,77.070312 11.09375x17.46875] + frag 0 from TextNode start: 0, length: 1, rect: [17,85.570312 11.09375x17.46875] "Y" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline @@ -90,5 +90,5 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,112.40625) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,124.40625) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/rowspan.txt b/Tests/LibWeb/Layout/expected/table/rowspan.txt index f44e73410b..fa3dc6792d 100644 --- a/Tests/LibWeb/Layout/expected/table/rowspan.txt +++ b/Tests/LibWeb/Layout/expected/table/rowspan.txt @@ -1,111 +1,111 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline - BlockContainer at (0,0) content-size 800x93.875 [BFC] children: not-inline + BlockContainer at (0,0) content-size 800x103.875 [BFC] children: not-inline BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline TextNode <#text> - BlockContainer at (8,8) content-size 784x77.875 children: not-inline + BlockContainer at (8,8) content-size 784x87.875 children: not-inline BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline TextNode <#text> - TableWrapper <(anonymous)> at (8,8) content-size 221.359375x77.875 [BFC] children: not-inline - Box at (8,8) content-size 221.359375x77.875 table-box [TFC] children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 229.359375x87.875 [BFC] children: not-inline + Box
at (8,8) content-size 229.359375x87.875 table-box [TFC] children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> Box at (8,8) content-size 221.359375x77.875 table-row-group children: not-inline - Box at (8,8) content-size 221.359375x19.46875 table-row children: not-inline + Box at (10,10) content-size 221.359375x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,27.46875) content-size 221.359375x19.46875 table-row children: not-inline + Box at (10,29.46875) content-size 221.359375x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,46.9375) content-size 221.359375x19.46875 table-row children: not-inline + Box at (10,48.9375) content-size 221.359375x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (8,66.40625) content-size 221.359375x19.46875 table-row children: not-inline + Box at (10,68.40625) content-size 221.359375x19.46875 table-row children: not-inline BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (108,108) content-size 584x10 table-row-group children: not-inline - Box at (108,108) content-size 584x10 table-row children: not-inline - BlockContainer at (109,113) content-size 582x0 table-cell [BFC] children: not-inline + Box at (110,110) content-size 584x10 table-row children: not-inline + BlockContainer at (111,115) content-size 582x0 table-cell [BFC] children: not-inline diff --git a/Tests/LibWeb/Layout/input/table/border-spacing-colspan.html b/Tests/LibWeb/Layout/input/table/border-spacing-colspan.html new file mode 100644 index 0000000000..7265529d1e --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/border-spacing-colspan.html @@ -0,0 +1,64 @@ + + + + + + + Separated table with colspan + + + + +
at (9,9) content-size 70.046875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,11) content-size 70.046875x17.46875 table-cell [BFC] children: inline line 0 width: 70.046875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [9,9 70.046875x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [11,11 70.046875x17.46875] "Header 1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (81.046875,9) content-size 72.515625x17.46875 table-cell [BFC] children: inline + BlockContainer at (85.046875,11) content-size 72.515625x17.46875 table-cell [BFC] children: inline line 0 width: 72.515625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [81.046875,9 72.515625x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [85.046875,11 72.515625x17.46875] "Header 2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (155.5625,9) content-size 72.796875x17.46875 table-cell [BFC] children: inline + BlockContainer at (161.5625,11) content-size 72.796875x17.46875 table-cell [BFC] children: inline line 0 width: 72.796875, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 8, rect: [155.5625,9 72.796875x17.46875] + frag 0 from TextNode start: 0, length: 8, rect: [161.5625,11 72.796875x17.46875] "Header 3" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,38.203125) content-size 70.046875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,43.203125) content-size 70.046875x17.46875 table-cell [BFC] children: inline line 0 width: 49.609375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [9,38.203125 49.609375x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [11,43.203125 49.609375x17.46875] "Row 1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (81.046875,28.46875) content-size 72.515625x17.46875 table-cell [BFC] children: inline + BlockContainer at (85.046875,32.46875) content-size 72.515625x17.46875 table-cell [BFC] children: inline line 0 width: 41.84375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [81.046875,28.46875 41.84375x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [85.046875,32.46875 41.84375x17.46875] "Cell 1" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (155.5625,28.46875) content-size 72.796875x17.46875 table-cell [BFC] children: inline + BlockContainer at (161.5625,32.46875) content-size 72.796875x17.46875 table-cell [BFC] children: inline line 0 width: 44.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [155.5625,28.46875 44.3125x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [161.5625,32.46875 44.3125x17.46875] "Cell 2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (81.046875,47.9375) content-size 72.515625x17.46875 table-cell [BFC] children: inline + BlockContainer at (85.046875,53.9375) content-size 72.515625x17.46875 table-cell [BFC] children: inline line 0 width: 44.59375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [81.046875,47.9375 44.59375x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [85.046875,53.9375 44.59375x17.46875] "Cell 3" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (155.5625,47.9375) content-size 72.796875x17.46875 table-cell [BFC] children: inline + BlockContainer at (161.5625,53.9375) content-size 72.796875x17.46875 table-cell [BFC] children: inline line 0 width: 43.25, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [155.5625,47.9375 43.25x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [161.5625,53.9375 43.25x17.46875] "Cell 4" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - Box
at (9,67.40625) content-size 70.046875x17.46875 table-cell [BFC] children: inline + BlockContainer at (11,75.40625) content-size 70.046875x17.46875 table-cell [BFC] children: inline line 0 width: 52.078125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 5, rect: [9,67.40625 52.078125x17.46875] + frag 0 from TextNode start: 0, length: 5, rect: [11,75.40625 52.078125x17.46875] "Row 2" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (81.046875,67.40625) content-size 72.515625x17.46875 table-cell [BFC] children: inline + BlockContainer at (85.046875,75.40625) content-size 72.515625x17.46875 table-cell [BFC] children: inline line 0 width: 43.953125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [81.046875,67.40625 43.953125x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [85.046875,75.40625 43.953125x17.46875] "Cell 5" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer at (155.5625,67.40625) content-size 72.796875x17.46875 table-cell [BFC] children: inline + BlockContainer at (161.5625,75.40625) content-size 72.796875x17.46875 table-cell [BFC] children: inline line 0 width: 44.234375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 - frag 0 from TextNode start: 0, length: 6, rect: [155.5625,67.40625 44.234375x17.46875] + frag 0 from TextNode start: 0, length: 6, rect: [161.5625,75.40625 44.234375x17.46875] "Cell 6" TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> BlockContainer <(anonymous)> (not painted) children: inline TextNode <#text> - BlockContainer <(anonymous)> at (8,85.875) content-size 784x0 children: inline + BlockContainer <(anonymous)> at (8,95.875) content-size 784x0 children: inline TextNode <#text> diff --git a/Tests/LibWeb/Layout/expected/table/table-width.txt b/Tests/LibWeb/Layout/expected/table/table-width.txt index 8cfbd08a13..fae1e62c10 100644 --- a/Tests/LibWeb/Layout/expected/table/table-width.txt +++ b/Tests/LibWeb/Layout/expected/table/table-width.txt @@ -1,8 +1,8 @@ Viewport <#document> at (0,0) content-size 800x600 children: not-inline BlockContainer at (0,0) content-size 800x600 [BFC] children: not-inline - BlockContainer at (8,8) content-size 784x210 children: not-inline - TableWrapper <(anonymous)> at (8,8) content-size 584x210 [BFC] children: not-inline - Box at (108,108) content-size 584x10 table-box [TFC] children: not-inline + BlockContainer at (8,8) content-size 784x214 children: not-inline + TableWrapper <(anonymous)> at (8,8) content-size 588x214 [BFC] children: not-inline + Box at (108,108) content-size 588x14 table-box [TFC] children: not-inline Box
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
AB1
C2
EF3
GH4
IJ5
+ + + + + \ No newline at end of file diff --git a/Tests/LibWeb/Layout/input/table/border-spacing-rowspan.html b/Tests/LibWeb/Layout/input/table/border-spacing-rowspan.html new file mode 100644 index 0000000000..007181e44d --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/border-spacing-rowspan.html @@ -0,0 +1,64 @@ + + + + + + + Separated table with rowspan + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AB1
D2
EF3
GH4
IJ5
+ + + + + \ No newline at end of file diff --git a/Tests/LibWeb/Layout/input/table/border-spacing.html b/Tests/LibWeb/Layout/input/table/border-spacing.html new file mode 100644 index 0000000000..691c8205a5 --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/border-spacing.html @@ -0,0 +1,65 @@ + + + + + + + Separated table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
AB1
CD2
EF3
GH4
IJ5
+ + + + + \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index 5d46624bdc..ada2adba65 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -249,13 +249,17 @@ void TableFormattingContext::compute_table_measures() baseline_max_content_size += rows_or_columns[rc_index].max_size; } + // Define the baseline border spacing as the sum of the horizontal border-spacing for any columns spanned by the cell, other than the one in which the cell originates. + auto baseline_border_spacing = border_spacing() * (cell_span_value - 1); + // The contribution of the cell is the sum of: // the min-content size of the column based on cells of span up to N-1 auto cell_min_contribution = rows_or_columns[cell_start_rc_index].min_size; // and the product of: // - the ratio of the max-content size based on cells of span up to N-1 of the column to the baseline max-content size // - the outer min-content size of the cell minus the baseline max-content size and baseline border spacing, or 0 if this is negative - cell_min_contribution += (rows_or_columns[cell_start_rc_index].max_size / baseline_max_content_size) * max(CSSPixels(0), cell_min_size(cell) - baseline_max_content_size); + cell_min_contribution += (rows_or_columns[cell_start_rc_index].max_size / baseline_max_content_size) + * max(CSSPixels(0), cell_min_size(cell) - baseline_max_content_size - baseline_border_spacing); // The contribution of the cell is the sum of: // the max-content size of the column based on cells of span up to N-1 @@ -263,7 +267,8 @@ void TableFormattingContext::compute_table_measures() // and the product of: // - the ratio of the max-content size based on cells of span up to N-1 of the column to the baseline max-content size // - the outer max-content size of the cell minus the baseline max-content size and the baseline border spacing, or 0 if this is negative - cell_max_contribution += (rows_or_columns[cell_start_rc_index].max_size / baseline_max_content_size) * max(CSSPixels(0), cell_max_size(cell) - baseline_max_content_size); + cell_max_contribution += (rows_or_columns[cell_start_rc_index].max_size / baseline_max_content_size) + * max(CSSPixels(0), cell_max_size(cell) - baseline_max_content_size - baseline_border_spacing); // Spread contribution to all rows / columns, since we've weighted the gap to the desired spanned size by the the // ratio of the max-content size based on cells of span up to N-1 of the row / column to the baseline max-content width. @@ -354,16 +359,23 @@ void TableFormattingContext::compute_table_width() used_width = min(used_width, computed_values.max_width().to_px(table_box(), width_of_table_wrapper_containing_block)); } - // The assignable table width is the used width of the table minus the total horizontal border spacing (if any). - // This is the width that we will be able to allocate to the columns. - table_box_state.set_content_width(used_width - table_box_state.border_left - table_box_state.border_right); + // Compute undistributable space due to border spacing: https://www.w3.org/TR/css-tables-3/#computing-undistributable-space. + auto undistributable_space = (m_columns.size() + 1) * border_spacing_horizontal(); + table_box_state.set_content_width(used_width - table_box_state.border_left - table_box_state.border_right + undistributable_space); } void TableFormattingContext::distribute_width_to_columns() { // Implements https://www.w3.org/TR/css-tables-3/#width-distribution-algorithm - CSSPixels available_width = m_state.get(table_box()).content_width(); + // The total horizontal border spacing is defined for each table: + // - For tables laid out in separated-borders mode containing at least one column, the horizontal component of the computed value of the border-spacing property times one plus the number of columns in the table + // - Otherwise, 0 + auto total_horizontal_border_spacing = m_columns.is_empty() ? 0 : (m_columns.size() + 1) * border_spacing_horizontal(); + + // The assignable table width is the used width of the table minus the total horizontal border spacing (if any). + // This is the width that we will be able to allocate to the columns. + CSSPixels available_width = m_state.get(table_box()).content_width() - total_horizontal_border_spacing; auto columns_total_used_width = [&]() { CSSPixels total_used_width = 0; @@ -547,7 +559,12 @@ void TableFormattingContext::compute_table_height(LayoutMode layout_mode) row.base_height = max(row.base_height, cell_used_height); } - cell_state.set_content_width((span_width - cell_state.border_box_left() - cell_state.border_box_right())); + // Compute cell width as specified by https://www.w3.org/TR/css-tables-3/#bounding-box-assignment: + // The position of any table-cell, table-track, or table-track-group box within the table is defined as the rectangle whose width/height is the sum of: + // - the widths/heights of all spanned visible columns/rows + // - the horizontal/vertical border-spacing times the amount of spanned visible columns/rows minus one + // FIXME: Account for visibility. + cell_state.set_content_width(span_width - cell_state.border_box_left() - cell_state.border_box_right() + (cell.column_span - 1) * border_spacing_horizontal()); if (auto independent_formatting_context = layout_inside(cell.box, layout_mode, cell_state.available_inner_space_or_constraints_from(*m_available_space))) { cell_state.set_content_height(independent_formatting_context->automatic_content_height()); independent_formatting_context->parent_context_did_dimension_child_root_box(); @@ -574,7 +591,6 @@ void TableFormattingContext::compute_table_height(LayoutMode layout_mode) sum_rows_height += row.base_height; } - // The height of a table is the sum of the row heights plus any cell spacing or borders. m_table_height = sum_rows_height; if (!table_box().computed_values().height().is_auto()) { @@ -632,7 +648,7 @@ void TableFormattingContext::compute_table_height(LayoutMode layout_mode) continue; } - cell_state.set_content_width((span_width - cell_state.border_box_left() - cell_state.border_box_right())); + cell_state.set_content_width(span_width - cell_state.border_box_left() - cell_state.border_box_right() + (cell.column_span - 1) * border_spacing_horizontal()); if (auto independent_formatting_context = layout_inside(cell.box, layout_mode, cell_state.available_inner_space_or_constraints_from(*m_available_space))) { independent_formatting_context->parent_context_did_dimension_child_root_box(); } @@ -699,8 +715,8 @@ void TableFormattingContext::position_row_boxes(CSSPixels& total_content_height) { auto const& table_state = m_state.get(table_box()); - CSSPixels row_top_offset = table_state.offset.y() + table_state.padding_top; - CSSPixels row_left_offset = table_state.border_left + table_state.padding_left; + CSSPixels row_top_offset = table_state.offset.y() + table_state.padding_top + border_spacing_vertical(); + CSSPixels row_left_offset = table_state.border_left + table_state.padding_left + border_spacing_horizontal(); for (size_t y = 0; y < m_rows.size(); y++) { auto& row = m_rows[y]; auto& row_state = m_state.get_mutable(row.box); @@ -739,6 +755,9 @@ void TableFormattingContext::position_row_boxes(CSSPixels& total_content_height) }); total_content_height = max(row_top_offset, row_group_top_offset) - table_state.offset.y() - table_state.padding_top; + // The height of a table is the sum of the row heights plus any cell spacing or borders. + // Note that we've already added one vertical border-spacing to row_top_offset, so it's sufficient to multiply it by row count here. + total_content_height += m_rows.size() * border_spacing_vertical(); } void TableFormattingContext::position_cell_boxes() @@ -775,7 +794,14 @@ void TableFormattingContext::position_cell_boxes() } } - cell_state.offset = row_state.offset.translated(cell_state.border_box_left() + m_columns[cell.column_index].left_offset, cell_state.border_box_top()); + // Compute cell position as specified by https://www.w3.org/TR/css-tables-3/#bounding-box-assignment: + // left/top location is the sum of: + // - for top: the height reserved for top captions (including margins), if any + // - the padding-left/padding-top and border-left-width/border-top-width of the table + // FIXME: Account for visibility. + cell_state.offset = row_state.offset.translated( + cell_state.border_box_left() + m_columns[cell.column_index].left_offset + cell.column_index * border_spacing_horizontal(), + cell_state.border_box_top() + cell.row_index * border_spacing_vertical()); } } @@ -881,6 +907,13 @@ CSSPixels TableFormattingContext::compute_row_content_height(Cell const& cell) c span_height += row_state.border_box_height(); } } + + // Compute cell height as specified by https://www.w3.org/TR/css-tables-3/#bounding-box-assignment: + // width/height is the sum of: + // - the widths/heights of all spanned visible columns/rows + // - the horizontal/vertical border-spacing times the amount of spanned visible columns/rows minus one + // FIXME: Account for visibility. + span_height += (cell.row_span - 1) * border_spacing_vertical(); return span_height; } @@ -1043,6 +1076,38 @@ CSSPixels TableFormattingContext::cell_max_size( return cell.max_width; } +template<> +CSSPixels TableFormattingContext::border_spacing() +{ + return border_spacing_vertical(); +} + +template<> +CSSPixels TableFormattingContext::border_spacing() +{ + return border_spacing_horizontal(); +} + +CSSPixels TableFormattingContext::border_spacing_horizontal() const +{ + auto const& computed_values = table_box().computed_values(); + // When a table is laid out in collapsed-borders mode, the border-spacing of the table-root is ignored (as if it was set to 0px): + // https://www.w3.org/TR/css-tables-3/#collapsed-style-overrides + if (computed_values.border_collapse() == CSS::BorderCollapse::Collapse) + return 0; + return computed_values.border_spacing_horizontal().to_px(table_box()); +} + +CSSPixels TableFormattingContext::border_spacing_vertical() const +{ + auto const& computed_values = table_box().computed_values(); + // When a table is laid out in collapsed-borders mode, the border-spacing of the table-root is ignored (as if it was set to 0px): + // https://www.w3.org/TR/css-tables-3/#collapsed-style-overrides + if (computed_values.border_collapse() == CSS::BorderCollapse::Collapse) + return 0; + return computed_values.border_spacing_vertical().to_px(table_box()); +} + template<> Vector& TableFormattingContext::table_rows_or_columns() { diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h index daa82658c4..928fa49d38 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -47,6 +47,8 @@ private: void position_row_boxes(CSSPixels&); void position_cell_boxes(); void border_conflict_resolution(); + CSSPixels border_spacing_horizontal() const; + CSSPixels border_spacing_vertical() const; CSSPixels m_table_height { 0 }; CSSPixels m_automatic_content_height { 0 }; @@ -107,6 +109,9 @@ private: template static CSSPixels cell_max_size(Cell const& cell); + template + CSSPixels border_spacing(); + template Vector& table_rows_or_columns();