Skip to content

Truly independent web browser

LibWeb: Don’t give a row-spanning cell’s height to its first row

sideshowbarker25c3d642daf1
diff --git a/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
index 468ec3c9d55..c028b1663ff 100644
--- a/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
@@ -2393,17 +2393,29 @@ impl<'pass> TableFormattingContext<'pass> {
let growing_max = growing_tracks
.iter()
.fold(CssPixels::default(), |sum, &index| sum + self.track_max(axis, index));
- let share_beyond_max = |index: usize, beyond_max: CssPixels| {
- if !growing_tracks.contains(&index) {
- CssPixels::default()
- } else if growing_max != CssPixels::default() {
- CssPixels::nearest_value_for(self.track_max(axis, index).to_double() / growing_max.to_double())
- * beyond_max
+ // Each growing track takes its share of what the cell needs beyond the baseline max-content size, in
+ // proportion to its max-content size. The shares are the differences between the rounded running totals
+ // of those proportions, so that they always add up to all of it, however many tracks share it.
+ // AD-HOC: The spec does not define behavior when baseline is zero. We distribute equally.
+ // This matches how undefined ratios are handled elsewhere.
+ let mut growing_fractions_before = Vec::with_capacity(growing_tracks.len() + 1);
+ growing_fractions_before.push(0.0);
+ let mut fraction_so_far = 0.0;
+ for &index in &growing_tracks {
+ fraction_so_far += if growing_max != CssPixels::default() {
+ self.track_max(axis, index).to_double() / growing_max.to_double()
} else {
- // AD-HOC: The spec does not define behavior when baseline is zero. We distribute equally.
- // This matches how undefined ratios are handled elsewhere.
- beyond_max / growing_tracks.len()
- }
+ 1.0 / growing_tracks.len() as f64
+ };
+ growing_fractions_before.push(fraction_so_far);
+ }
+ let share_beyond_max = |index: usize, beyond_max: CssPixels| {
+ let Ok(position) = growing_tracks.binary_search(&index) else {
+ return CssPixels::default();
+ };
+ let running_total = |fraction: f64| CssPixels::nearest_value_for(fraction * beyond_max.to_double());
+ running_total(growing_fractions_before[position + 1])
+ - running_total(growing_fractions_before[position])
};
// Add contribution from 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.
@@ -3057,6 +3069,7 @@ impl<'pass> TableFormattingContext<'pass> {
.show
.hidden_by_collapsed_columns = hidden_by_collapsed_columns;
let height = style.height();
+ let mut specified_outer_block_size = None;
if !self.rows[cell.row_index].is_collapsed && height.is_length() {
let offsets = cell_box.border_box_top(collapsed) + cell_box.border_box_bottom(collapsed);
let cell_size = self.cell_specified_outer_block_size(
@@ -3066,7 +3079,13 @@ impl<'pass> TableFormattingContext<'pass> {
offsets,
);
cell_box.set_content_block_size(cell_size - offsets);
- self.rows[cell.row_index].base_block_size = self.rows[cell.row_index].base_block_size.max(cell_size);
+ specified_outer_block_size = Some(cell_size);
+ // Only a cell that spans its row exclusively gives the row its specified block size (see below). A
+ // cell spanning several rows reaches them through the row measures instead, as its minimum.
+ if cell.row_span == 1 {
+ self.rows[cell.row_index].base_block_size =
+ self.rows[cell.row_index].base_block_size.max(cell_size);
+ }
}
// Compute cell inline size as specified by https://www.w3.org/TR/css-tables-3/#bounding-box-assignment:
// The position of any table cell, track, or track group is defined by the sums of its spanned columns and rows:
@@ -3101,7 +3120,11 @@ impl<'pass> TableFormattingContext<'pass> {
);
let cell_box = self.cell_layouts[cell_index].box_cells;
if self.needs_row_measurement {
- let measured = cell_box.border_box_block_size(collapsed);
+ // The outer min-content block size of a cell is the larger of its laid-out block size and its
+ // specified one.
+ let measured = cell_box
+ .border_box_block_size(collapsed)
+ .max(specified_outer_block_size.unwrap_or_default());
self.cells[cell_index].outer_min_block_size = measured;
self.cells[cell_index].outer_max_block_size = measured;
}
diff --git a/Tests/LibWeb/Layout/expected/table/avoid-div-by-zero-in-table-measures.txt b/Tests/LibWeb/Layout/expected/table/avoid-div-by-zero-in-table-measures.txt
index eda99e83fe4..a63ebd113fc 100644
--- a/Tests/LibWeb/Layout/expected/table/avoid-div-by-zero-in-table-measures.txt
+++ b/Tests/LibWeb/Layout/expected/table/avoid-div-by-zero-in-table-measures.txt
@@ -1,11 +1,11 @@
Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children: not-inline
BlockContainer <html> at [0,0] [0+0+0 800 0+0+0] [0+0+0 38 0+0+0] [BFC] children: not-inline
BlockContainer <body> at [8,8] [8+0+0 784 0+0+8] [8+0+0 22 0+0+8] children: not-inline
- TableWrapper <(anonymous)> at [8,8] [0+0+0 20.25 0+0+763.75] [0+0+0 22 0+0+0] [BFC] children: not-inline
- Box <table> at [8,8] table-box [0+0+0 20.25 0+0+0] [0+0+0 22 0+0+0] [TFC] children: not-inline
- Box <tbody> at [10,10] table-row-group [0+0+0 16.25 0+0+0] [0+0+0 18 0+0+0] children: not-inline
- Box <tr> at [10,10] table-row [0+0+0 16.25 0+0+0] [0+0+0 18 0+0+0] children: not-inline
- BlockContainer <td> at [11,11] table-cell [0+0+1 14.25 1+0+0] [0+0+1 16 1+0+0] [BFC] children: inline
+ TableWrapper <(anonymous)> at [8,8] [0+0+0 20.265625 0+0+763.734375] [0+0+0 22 0+0+0] [BFC] children: not-inline
+ Box <table> at [8,8] table-box [0+0+0 20.265625 0+0+0] [0+0+0 22 0+0+0] [TFC] children: not-inline
+ Box <tbody> at [10,10] table-row-group [0+0+0 16.265625 0+0+0] [0+0+0 18 0+0+0] children: not-inline
+ Box <tr> at [10,10] table-row [0+0+0 16.265625 0+0+0] [0+0+0 18 0+0+0] children: not-inline
+ BlockContainer <td> at [11,11] table-cell [0+0+1 14.265625 1+0+0] [0+0+1 16 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [11,11 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/colspan-width-goes-to-unconstrained-columns.txt b/Tests/LibWeb/Layout/expected/table/colspan-width-goes-to-unconstrained-columns.txt
index dce693a1716..fff2bbc6e03 100644
--- a/Tests/LibWeb/Layout/expected/table/colspan-width-goes-to-unconstrained-columns.txt
+++ b/Tests/LibWeb/Layout/expected/table/colspan-width-goes-to-unconstrained-columns.txt
@@ -10,16 +10,16 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
"wide"
TextNode <#text> (not painted)
Box <tr> at [10,32] table-row [0+0+0 504 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <td> at [12,34] table-cell [0+1+1 249.578125 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
+ BlockContainer <td> at [12,34] table-cell [0+1+1 250.9375 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [12,34 9.34375x16] baseline: 13
"a"
TextNode <#text> (not painted)
- BlockContainer <td> at [267.578125,34] table-cell [0+1+1 4.34375 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
- frag 0 from TextNode start: 0, length: 1, rect: [267.578125,34 4.34375x16] baseline: 13
+ BlockContainer <td> at [268.9375,34] table-cell [0+1+1 4.34375 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
+ frag 0 from TextNode start: 0, length: 1, rect: [268.9375,34 4.34375x16] baseline: 13
"."
TextNode <#text> (not painted)
- BlockContainer <td> at [277.921875,34] table-cell [0+1+1 234.078125 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
- frag 0 from TextNode start: 0, length: 1, rect: [277.921875,34 8.390625x16] baseline: 13
+ BlockContainer <td> at [279.28125,34] table-cell [0+1+1 232.71875 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
+ frag 0 from TextNode start: 0, length: 1, rect: [279.28125,34 8.390625x16] baseline: 13
"z"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Text/expected/table/rowspan-ends-at-row-group.txt b/Tests/LibWeb/Text/expected/table/rowspan-ends-at-row-group.txt
index d43b7f7d0cb..9c7b043ba13 100644
--- a/Tests/LibWeb/Text/expected/table/rowspan-ends-at-row-group.txt
+++ b/Tests/LibWeb/Text/expected/table/rowspan-ends-at-row-group.txt
@@ -1,4 +1,4 @@
-huge-rowspans: 80x180; a@0,0+60 b@20,20+40 1@40,40+20 x@60,40+20 a@0,60+60 b@20,80+40 2@40,100+20 x@60,100+20 a@0,120+60 b@20,140+40 3@40,160+20 x@60,160+20
+huge-rowspans: 80x60; a@0,0+20 b@20,0+20 1@40,0+20 x@60,0+20 a@0,20+20 b@20,20+20 2@40,20+20 x@60,20+20 a@0,40+20 b@20,40+20 3@40,40+20 x@60,40+20
rowspan-into-next-tbody: 40x40; a@0,0+20 1@20,0+20 2@0,20+20 x@20,20+20
thead-rowspan: 40x40; h@0,0+20 1@20,0+20 2@0,20+20 x@20,20+20
tfoot-moved-after-tbody: 40x40; f@0,20+20 x@20,20+20 a@0,0+20 1@20,0+20
diff --git a/Tests/LibWeb/Text/expected/table/rowspan-specified-block-size.txt b/Tests/LibWeb/Text/expected/table/rowspan-specified-block-size.txt
new file mode 100644
index 00000000000..f970c85e033
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/table/rowspan-specified-block-size.txt
@@ -0,0 +1,12 @@
+spanning-cell-height-only: 40x20; a@0,0+20 1@20,0+20
+spanning-cell-height-10: 40x20; a@0,0+20 1@20,0+20
+spanning-cell-height-40: 40x40; a@0,0+40 1@20,0+40
+spanning-no-height: 40x20; a@0,0+20 1@20,0+20
+spanning-cell-min-height: 40x20; a@0,0+20 1@20,0+20
+first-row-has-cell: 40x40; a@0,0+40 0@20,0+20 1@20,20+20
+one-group: 80x20; a@0,0+20 b@20,0+20 1@40,0+20 x@60,0+20
+rows-already-tall-enough: 40x100; a@0,0+100 1@20,0+20 2@20,20+30 3@20,50+50
+rows-grown-in-proportion: 40x160; a@0,0+160 1@20,0+32 2@20,32+48 3@20,80+80
+zero-baseline-many-rows: height 10.00
+zero-baseline-seven-rows: height 1.00
+tall-cell-over-many-short-rows: height 1000
diff --git a/Tests/LibWeb/Text/input/table/rowspan-specified-block-size.html b/Tests/LibWeb/Text/input/table/rowspan-specified-block-size.html
new file mode 100644
index 00000000000..632828eaeb1
--- /dev/null
+++ b/Tests/LibWeb/Text/input/table/rowspan-specified-block-size.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<style>
+ table { border-spacing: 0; margin-bottom: 6px; font: 16px/20px monospace; }
+ td { width: 20px; padding: 0; }
+ .h td { height: 20px; }
+</style>
+<table id="spanning-cell-height-only"><tr><td rowspan="2" style="height: 20px">a</td></tr><tr><td>1</td></tr></table>
+<table id="spanning-cell-height-10"><tr><td rowspan="2" style="height: 10px">a</td></tr><tr><td>1</td></tr></table>
+<table id="spanning-cell-height-40"><tr><td rowspan="2" style="height: 40px">a</td></tr><tr><td>1</td></tr></table>
+<table id="spanning-no-height"><tr><td rowspan="2">a</td></tr><tr><td>1</td></tr></table>
+<table id="spanning-cell-min-height"><tr><td rowspan="2" style="min-height: 20px">a</td></tr><tr><td>1</td></tr></table>
+<table id="first-row-has-cell"><tr><td rowspan="2" style="height: 20px">a</td><td>0</td></tr><tr><td>1</td></tr></table>
+<table id="one-group" class="h"><tr><td rowspan="3">a</td></tr><tr><td rowspan="2">b</td></tr><tr><td>1</td><td>x</td></tr></table>
+<table id="rows-already-tall-enough" style="border-collapse: collapse"><tr style="height: 20px"><td rowspan="3" style="height: 100px">a</td><td>1</td></tr><tr style="height: 30px"><td>2</td></tr><tr style="height: 50px"><td>3</td></tr></table>
+<table id="rows-grown-in-proportion" style="border-collapse: collapse"><tr style="height: 20px"><td rowspan="3" style="height: 160px">a</td><td>1</td></tr><tr style="height: 30px"><td>2</td></tr><tr style="height: 50px"><td>3</td></tr></table>
+<table id="zero-baseline-many-rows" style="border-spacing: 0"><tr><td rowspan="1000" style="height: 10px; padding: 0; vertical-align: top"></td></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr></table>
+<table id="zero-baseline-seven-rows" style="border-spacing: 0"><tr><td rowspan="7" style="height: 1px; padding: 0; vertical-align: top"></td></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr><tr></tr></table>
+<table id="tall-cell-over-many-short-rows" style="border-collapse: collapse"><tr><td rowspan="200" style="height: 1000px"></td><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr><tr><td style="height: 1px"></td></tr></table>
+<script src="../include.js"></script>
+<script>
+ test(() => {
+ for (const table of document.querySelectorAll("table")) {
+ const origin = table.getBoundingClientRect();
+ const cells = [...table.querySelectorAll("td")].map(cell => {
+ const r = cell.getBoundingClientRect();
+ return `${cell.textContent}@${Math.round(r.left - origin.left)},${Math.round(r.top - origin.top)}+${Math.round(r.height)}`;
+ });
+ if (table.id.startsWith("zero-baseline")) {
+ println(`${table.id}: height ${origin.height.toFixed(2)}`);
+ continue;
+ }
+ if (table.rows.length > 10) {
+ println(`${table.id}: height ${Math.round(origin.height)}`);
+ continue;
+ }
+ println(`${table.id}: ${Math.round(origin.width)}x${Math.round(origin.height)}; ${cells.join(" ")}`);
+ }
+ });
+</script>