Skip to content

Truly independent web browser

LibWeb: Align table cell contents with a shift instead of padding

Aliaksandr Kalenik4e2f14f208c0
diff --git a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
index 7f3a6c827e9..42ba425d121 100644
--- a/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/block_formatting_context.rs
@@ -1163,22 +1163,10 @@ pub(crate) fn aligns_content_in_block_axis(facts: &NodeFacts<'_>) -> bool {
}
pub(crate) fn content_alignment_offset(style: ComputedValuesView<'_>, free_space: CssPixels) -> CssPixels {
- let (keyword, safety) = box_alignment::ContentKeyword::align_content_of(style);
- // https://drafts.csswg.org/css-align-3/#baseline-values
- // The fallback alignment for last baseline is safe end.
- let keyword = if style.align_content_is_last_baseline() {
- box_alignment::ContentKeyword::End
- } else {
- keyword
- };
- // https://drafts.csswg.org/css-align-3/#distribution-block
- // If a <content-distribution> is specified its fallback alignment is used instead.
// https://drafts.csswg.org/css-align-3/#auto-safety
// UAs that have not implemented the “smart” default behavior must behave as safe for align-content on block
// containers and unsafe otherwise.
- keyword
- .resolve(safety, box_alignment::AxisDirections::of(true, None))
- .offset(free_space, box_alignment::OverflowSafety::Safe)
+ box_alignment::block_container_content_alignment(style).offset(free_space, box_alignment::OverflowSafety::Safe)
}
impl<'pass> formatting_context::FormattingContextAlgorithm<'pass> for BlockFormattingContext<'pass> {
diff --git a/Libraries/LibWeb/Rust/src/layout/box_alignment.rs b/Libraries/LibWeb/Rust/src/layout/box_alignment.rs
index 9cd09592893..a5e464c31ee 100644
--- a/Libraries/LibWeb/Rust/src/layout/box_alignment.rs
+++ b/Libraries/LibWeb/Rust/src/layout/box_alignment.rs
@@ -357,6 +357,51 @@ impl ContentKeyword {
}
}
+/// The alignment of the contents of a block container styled `style` along its block axis.
+pub(crate) fn block_container_content_alignment(style: ComputedValuesView<'_>) -> ContentAlignment {
+ let (keyword, safety) = ContentKeyword::align_content_of(style);
+ // https://drafts.csswg.org/css-align-3/#baseline-values
+ // The fallback alignment for last baseline is safe end.
+ let keyword = if style.align_content_is_last_baseline() {
+ ContentKeyword::End
+ } else {
+ keyword
+ };
+ // https://drafts.csswg.org/css-align-3/#distribution-block
+ // If a <content-distribution> is specified its fallback alignment is used instead.
+ keyword.resolve(safety, AxisDirections::of(true, None))
+}
+
+/// How a table cell aligns its contents along the block axis.
+#[derive(Clone, Copy, Debug, PartialEq, Eq)]
+pub(crate) enum CellAlignment {
+ /// The first baseline of the cell lines up with the baseline of the first row it spans.
+ Baseline,
+ Content(ContentAlignment),
+}
+
+/// The alignment of the contents of a table cell styled `style`. align-content applies to table cells, where a value
+/// other than normal overrides vertical-align: https://drafts.csswg.org/css-align-3/#distribution-block
+/// Of the vertical-align values, "the following values apply to cells: baseline, top, middle, bottom", while the others
+/// "do not apply to cells; the cell is aligned at the baseline instead": https://www.w3.org/TR/CSS22/tables.html#height-layout
+pub(crate) fn cell_alignment(style: StyleValues<'_>) -> CellAlignment {
+ match style.align_content() {
+ align_content::NORMAL => {}
+ align_content::BASELINE if !style.align_content_is_last_baseline() => return CellAlignment::Baseline,
+ _ => return CellAlignment::Content(block_container_content_alignment(*style)),
+ }
+ if !style.vertical_align_is_keyword() {
+ return CellAlignment::Baseline;
+ }
+ let keyword = match style.vertical_align_keyword() {
+ vertical_align::TOP => ContentKeyword::Start,
+ vertical_align::MIDDLE => ContentKeyword::Center,
+ vertical_align::BOTTOM => ContentKeyword::End,
+ _ => return CellAlignment::Baseline,
+ };
+ CellAlignment::Content(keyword.resolve(OverflowSafety::Unsafe, AxisDirections::of(true, None)))
+}
+
/// https://drafts.csswg.org/css-align-3/#distribution-values
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(crate) enum ContentDistribution {
diff --git a/Libraries/LibWeb/Rust/src/layout/fc_run_cache.rs b/Libraries/LibWeb/Rust/src/layout/fc_run_cache.rs
index cf2581e7f80..b59b88068b8 100644
--- a/Libraries/LibWeb/Rust/src/layout/fc_run_cache.rs
+++ b/Libraries/LibWeb/Rust/src/layout/fc_run_cache.rs
@@ -43,6 +43,8 @@ pub(crate) struct RunObservations {
/// Whether the root's parent owns the root's input cells, which the run then leaves as they were handed to it but
/// for the content block size the root adopts.
pub(super) parent_owns_root_cells: bool,
+ /// Whether the run laid out absolutely positioned boxes against the final sizes and box sides of its root.
+ pub(super) laid_out_abspos_contained_by_root: bool,
}
/// The cells of the root of the run that produced `result`, as the root's parent keeps them where `probe`, which the
@@ -120,6 +122,7 @@ pub(crate) fn observations_of(
RunObservations {
never_observed,
parent_owns_root_cells: facts.parent_owns_root_input_cells,
+ laid_out_abspos_contained_by_root: facts.laid_out_abspos_contained_by_root,
table_cell_block_paddings_unobserved: facts.parent_owns_root_input_cells
&& NodeFacts::new(&run.pass, run.box_).is_table_cell()
&& !run_observes_root_block_padding(
@@ -427,6 +430,7 @@ fn sizing_directives_match_ignoring_unobserved(
forced_min_border_box_block_size,
table_box_content_block_offset_in_wrapper,
content_block_size_after_run,
+ table_cell_contents_block_offset,
outer_float_intrusion_before_list_item_children,
treat_block_axis_percentage_insets_as_auto_beyond_root,
math_stretch_size_constraint,
@@ -437,6 +441,7 @@ fn sizing_directives_match_ignoring_unobserved(
&& table_box_content_block_offset_in_wrapper == b.table_box_content_block_offset_in_wrapper
&& (content_block_size_after_run == b.content_block_size_after_run
|| content_block_size_adopted_after_run_unobserved)
+ && table_cell_contents_block_offset == b.table_cell_contents_block_offset
&& outer_float_intrusion_before_list_item_children == b.outer_float_intrusion_before_list_item_children
&& treat_block_axis_percentage_insets_as_auto_beyond_root
== b.treat_block_axis_percentage_insets_as_auto_beyond_root
@@ -1256,6 +1261,7 @@ mod tests {
},
table_cell_block_paddings_unobserved: false,
parent_owns_root_cells: false,
+ laid_out_abspos_contained_by_root: false,
},
residue: None,
},
@@ -1667,8 +1673,7 @@ mod tests {
let stored = key_of(item_input.clone());
let mut adopting_input = item_input;
- adopting_input.sizing.content_block_size_after_run =
- geometry::ContentBlockSizeAfterRun::GrownFromAspectRatioBlockSize(px(40));
+ adopting_input.sizing.content_block_size_after_run = geometry::ContentBlockSizeAfterRun::Given(px(40));
let probe = key_of(adopting_input);
assert!(!stored.matches(&probe, RunInputsTheStoredRunNeverObserved::default()));
diff --git a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
index b06d3dccf9b..8d7f4771390 100644
--- a/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/flex_formatting_context.rs
@@ -3231,8 +3231,7 @@ impl<'pass> FlexFormattingContext<'pass> {
.is_some()
&& let Some(cross_size) = self.flex_items[index].cross_size
{
- input.sizing.content_block_size_after_run =
- geometry::ContentBlockSizeAfterRun::GrownFromAspectRatioBlockSize(cross_size);
+ input.sizing.content_block_size_after_run = geometry::ContentBlockSizeAfterRun::Given(cross_size);
}
input
}
diff --git a/Libraries/LibWeb/Rust/src/layout/formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/formatting_context.rs
index 774b1272e80..54ce0d0ad61 100644
--- a/Libraries/LibWeb/Rust/src/layout/formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/formatting_context.rs
@@ -458,6 +458,12 @@ impl PlacedChild {
self
}
+ /// The child, whose laid out contents its parent moves by `shift` in the frame of the run placing it.
+ pub(crate) fn with_contents_shift(mut self, shift: FfiCssPixelPoint) -> Self {
+ self.contents_shift = shift;
+ self
+ }
+
/// The child, a block-level box, with the offset the relative positioning of the inline boxes it interrupts gives
/// it.
pub(crate) fn with_offset_from_relatively_positioned_inline_ancestors(mut self, offset: FfiCssPixelPoint) -> Self {
@@ -2646,19 +2652,28 @@ fn lay_out_run_root_and_contents<'pass>(
}
let root_cells_left_by_run = root.get();
let root_in_own_frame_left_by_run = root_cells_left_by_run.in_frame(parent_frame, own_frame);
- let content_alignment_offset = FfiCssPixelPoint {
+ let table_cell_contents_offset = FfiCssPixelPoint {
x: CssPixels::default(),
- y: match laid_out_content_block_size {
- Some(content_block_size) if block_formatting_context::aligns_content_in_block_axis(&containment_facts) => {
- block_formatting_context::content_alignment_offset(
- *containment_facts.style(),
- root_in_own_frame_left_by_run.content_block_size - content_block_size,
- )
- }
- _ => CssPixels::default(),
- },
+ y: input.sizing.table_cell_contents_block_offset,
};
- if content_alignment_offset.y != CssPixels::default() {
+ let content_alignment_offset = point_add(
+ FfiCssPixelPoint {
+ x: CssPixels::default(),
+ y: match laid_out_content_block_size {
+ Some(content_block_size)
+ if block_formatting_context::aligns_content_in_block_axis(&containment_facts) =>
+ {
+ block_formatting_context::content_alignment_offset(
+ *containment_facts.style(),
+ root_in_own_frame_left_by_run.content_block_size - content_block_size,
+ )
+ }
+ _ => CssPixels::default(),
+ },
+ },
+ own_frame.offset_from_physical(parent_frame.offset_to_physical(table_cell_contents_offset)),
+ );
+ if content_alignment_offset != FfiCssPixelPoint::default() {
if let Some(fragments) = run.fragments {
fragments.translate_root_contents(&pass, content_alignment_offset);
}
@@ -2686,7 +2701,7 @@ fn lay_out_run_root_and_contents<'pass>(
own_frame.writing_mode(),
)
.map(|content| {
- if content_alignment_offset.y == CssPixels::default() {
+ if content_alignment_offset == FfiCssPixelPoint::default() {
content
} else {
inline_content::InlineContent::concatenate_translated(&[(content, content_alignment_offset)])
@@ -3120,6 +3135,11 @@ impl ChildLayout {
);
}
+ /// Whether the child's run laid out absolutely positioned boxes against the final sizes and box sides of the child.
+ pub(crate) fn laid_out_abspos_contained_by_root(&self) -> bool {
+ matches!(self, Self::Laid(layout) if layout.observed.laid_out_abspos_contained_by_root)
+ }
+
/// What placing the child takes of its layout.
pub(crate) fn placed_child(&self) -> PlacedChild {
PlacedChild::of_layout(self)
@@ -3413,37 +3433,6 @@ pub(crate) fn leave_child_unplaced(
}
}
-/// The run a table cell's committing run will be (see layout_inside_child_with_input_cells), but for the intrinsic
-/// block padding that its table hands it once rows are sized. Laid out ahead of that padding, its outputs stay in the
-/// run cache, and the committing run replays them unless they show that the run observed the root's block padding (see
-/// fc_run_cache::run_observes_root_block_padding).
-pub(crate) fn table_cell_run_shape_ahead_of_its_intrinsic_block_padding(
- run: &FormattingContextRun,
- table_box: &impl BoxMetricCells,
- cell: Node,
- cell_input_cells: used_values::RootInputCells,
- input: LayoutInput,
-) -> ChildRunShape {
- debug_assert!(matches!(
- input.participation,
- ParticipationInParentFormattingContext::Item
- ));
- // NB: A table cell is a containing block of its own to the percentage block insets of its descendants.
- let plan = child_run_plan(
- run,
- cell,
- formatting_context_type_created_by_box(NodeFacts::new(&run.pass, cell)),
- input,
- false,
- run.percentage_block_insets_of_root_children_have_definite_basis(table_box),
- );
- ChildRunShape {
- node: cell,
- key: fc_run_cache::LayoutRequest::new(&run.pass, plan.fc_type, plan.input, cell_input_cells),
- root_containing_block: plan.root_containing_block,
- }
-}
-
#[derive(Clone, Debug, PartialEq)]
pub(crate) struct ChildRunShape {
pub(crate) node: Node,
@@ -3578,7 +3567,7 @@ pub(super) fn content_block_size_adopted_after_run(
match input.sizing.content_block_size_after_run {
geometry::ContentBlockSizeAfterRun::HandedOver => None,
geometry::ContentBlockSizeAfterRun::Automatic => Some(automatic_content_block_size),
- geometry::ContentBlockSizeAfterRun::GrownFromAspectRatioBlockSize(block_size) => Some(block_size),
+ geometry::ContentBlockSizeAfterRun::Given(block_size) => Some(block_size),
}
}
diff --git a/Libraries/LibWeb/Rust/src/layout/geometry.rs b/Libraries/LibWeb/Rust/src/layout/geometry.rs
index 2865d221851..5a24c8c8b90 100644
--- a/Libraries/LibWeb/Rust/src/layout/geometry.rs
+++ b/Libraries/LibWeb/Rust/src/layout/geometry.rs
@@ -427,6 +427,9 @@ pub(crate) struct RootSizingDirectives {
// wrapper) can be placed in wrapper coordinates.
pub(crate) table_box_content_block_offset_in_wrapper: PackedOptionalCssPixels,
pub(crate) content_block_size_after_run: ContentBlockSizeAfterRun,
+ // Input-only: how far the run of a table cell moves the contents of its root along the block axis, to align them
+ // in the block size the rows it spans give it after the run (see ContentBlockSizeAfterRun::Given).
+ pub(crate) table_cell_contents_block_offset: CssPixels,
pub(crate) outer_float_intrusion_before_list_item_children: inline_formatting_context::SpaceUsedByFloats,
pub(crate) treat_block_axis_percentage_insets_as_auto_beyond_root: bool,
pub(crate) root_is_measured_for_its_content_block_size: bool,
@@ -443,9 +446,10 @@ pub(crate) enum ContentBlockSizeAfterRun {
HandedOver,
/// Its automatic content block size.
Automatic,
- /// A flex or grid item lays out its content against the block size transferred through its aspect ratio, then
- /// takes this block size, which the automatic minimum size grew to fit the content.
- GrownFromAspectRatioBlockSize(CssPixels),
+ /// This one, once its contents are laid out against the one its container handed it: a flex or grid item laid out
+ /// against the block size transferred through its aspect ratio takes the one its automatic minimum size grew to
+ /// fit the content, and a table cell takes the block size of the rows it spans.
+ Given(CssPixels),
}
/// The size that MathML layout asks the core operator of an embellished operator to stretch to cover.
diff --git a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
index 535cedb70c8..c6769ccd7de 100644
--- a/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/grid_formatting_context.rs
@@ -4977,8 +4977,7 @@ impl<'pass> GridFormattingContext<'pass> {
if let Some(transferred) = item.block_size_transferred_through_aspect_ratio {
// NB: The content is laid out against the block size transferred through the aspect ratio, and the item
// grows to its used block size afterwards.
- sizing.content_block_size_after_run =
- geometry::ContentBlockSizeAfterRun::GrownFromAspectRatioBlockSize(cells.content_block_size);
+ sizing.content_block_size_after_run = geometry::ContentBlockSizeAfterRun::Given(cells.content_block_size);
cells.set_content_block_size(transferred);
}
self.update_cells_of(item, |item_cells| *item_cells = cells);
diff --git a/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs b/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
index 4f7d1304cf6..9498de09fdf 100644
--- a/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
+++ b/Libraries/LibWeb/Rust/src/layout/table_formatting_context.rs
@@ -605,13 +605,6 @@ pub(crate) fn distribute_inline_size(columns: &mut [Column], available: CssPixel
distribute_excess(columns, available, fixed);
}
-#[derive(Clone, Copy, Debug, PartialEq, Eq)]
-struct TableCellMeasurement {
- automatic_content_block_size: CssPixels,
- baselines: DerivedBaselines,
- depends_on_percentage_block_size: bool,
-}
-
/// What a table keeps of a cell while it lays the cell out.
#[derive(Default)]
struct CellLayoutState {
@@ -621,15 +614,17 @@ struct CellLayoutState {
/// What the cell's fragment shows of the table's layout.
fragment_facts: run_state::FragmentFactsDecidedByParent,
inside_layout_input: AvailableSpace,
+ /// The content block size the table hands the cell's run, which the cell's contents resolve percentages against.
pre_layout_content_block_size: CssPixels,
- defers_inside_layout: bool,
- measurement: Option<TableCellMeasurement>,
/// What the layout of the cell hands its placement, which places every cell once the rows are positioned.
fragment_arrival: Option<fragment_tree::RunRootFragment>,
- /// What placing the cell takes of the box its committing layout handed back.
+ /// What placing the cell takes of the box its layout handed back.
placed: Option<formatting_context::PlacedChild>,
- /// The baselines of the cell's contents, once its layout handed the box back to this table, which keeps them.
- content_baselines_of_handed_back_box: Option<DerivedBaselines>,
+ content_baselines: DerivedBaselines,
+ /// Whether the cell's run laid out the absolutely positioned boxes the cell contains against its final size.
+ run_laid_out_abspos_contained_by_cell: bool,
+ /// How far the table moves the contents of the cell along the block axis to align them in the rows it spans.
+ contents_block_offset: CssPixels,
}
#[derive(Clone, Copy)]
@@ -2912,57 +2907,40 @@ impl<'pass> TableFormattingContext<'pass> {
}
}
+ /// Lays out the contents of the cell at `cell_index` with `sizing`, in the cells and with the input this table
+ /// keeps of it, and keeps what its layout hands back.
fn layout_inside_cell(
&mut self,
run: &FormattingContextRun<'pass>,
cell_index: usize,
- input: AvailableSpace,
- adopt_automatic_content_block_size: bool,
- ) -> (DerivedBaselines, Option<fragment_tree::RunRootFragment>) {
- let layout_input = LayoutInput {
- available_space: input,
- containing_block_constraints: ContainingBlockConstraints::default(),
- sizing: RootSizingDirectives {
- content_block_size_after_run: if adopt_automatic_content_block_size {
- geometry::ContentBlockSizeAfterRun::Automatic
- } else {
- geometry::ContentBlockSizeAfterRun::HandedOver
- },
- ..RootSizingDirectives::default()
- },
- participation: ParticipationInParentFormattingContext::Item,
- };
+ sizing: RootSizingDirectives,
+ ) {
let cell = self.cells[cell_index];
+ let layout = &self.cell_layouts[cell_index];
let laid_out = formatting_context::layout_inside_child_with_input_cells(
run,
None,
None,
cell.box_,
- layout_input,
- self.cell_layouts[cell_index].box_cells,
+ LayoutInput {
+ available_space: layout.inside_layout_input,
+ containing_block_constraints: ContainingBlockConstraints::default(),
+ sizing,
+ participation: ParticipationInParentFormattingContext::Item,
+ },
+ layout.box_cells,
None,
false,
// NB: A table cell is a containing block of its own to the percentage block insets of its descendants.
run.percentage_block_insets_of_root_children_have_definite_basis(&self.table_box_cells),
);
- self.cell_layouts[cell_index].box_cells = laid_out.cells();
- let baselines = laid_out.baselines();
- self.cell_layouts[cell_index].content_baselines_of_handed_back_box = Some(baselines);
laid_out.report_percentage_block_size_dependency_of(run, cell.box_);
- self.cell_layouts[cell_index].placed = Some(laid_out.placed_child());
- (baselines, laid_out.into_fragment_arrival(run))
- }
-
- fn keep_fragment_arrival_of_cell(
- &mut self,
- cell_index: usize,
- fragment_arrival: Option<fragment_tree::RunRootFragment>,
- ) {
- debug_assert!(
- self.cell_layouts[cell_index].fragment_arrival.is_none(),
- "a cell is laid out once before its placement"
- );
- self.cell_layouts[cell_index].fragment_arrival = fragment_arrival;
+ let layout = &mut self.cell_layouts[cell_index];
+ layout.box_cells = laid_out.cells();
+ layout.content_baselines = laid_out.baselines();
+ layout.run_laid_out_abspos_contained_by_cell = laid_out.laid_out_abspos_contained_by_root();
+ layout.placed = Some(laid_out.placed_child());
+ layout.fragment_arrival = laid_out.into_fragment_arrival(run);
}
/// The baseline of a cell, from the top of its border box: "The baseline of a cell is the baseline of the first
@@ -2970,26 +2948,11 @@ impl<'pass> TableFormattingContext<'pass> {
/// such line box or table-row, the baseline is the bottom of content edge of the cell."
/// https://www.w3.org/TR/CSS22/tables.html#height-layout
/// The cell's own 'vertical-align' says where the cell goes in its row, not where its baseline is.
- fn cell_baseline(&self, cell_index: usize, committing_run_baselines: Option<DerivedBaselines>) -> CssPixels {
- let cell_box = &self.cell_layouts[cell_index].box_cells;
- // NB: A cell neither laid out nor handed back has no baselines yet.
- let content_baselines = committing_run_baselines
- .or(self.cell_layouts[cell_index].content_baselines_of_handed_back_box)
- .unwrap_or_default();
+ fn cell_baseline(&self, cell_index: usize) -> CssPixels {
+ let layout = &self.cell_layouts[cell_index];
+ let cell_box = &layout.box_cells;
let collapsed = cell_box.uses_collapsing_borders_model;
- cell_box.border_box_top(collapsed) + content_baselines.first.unwrap_or(cell_box.content_block_size)
- }
-
- /// Whether a cell is aligned at the baseline of its row. Of the 'vertical-align' values, "the following values
- /// apply to cells: baseline, top, middle, bottom", while sub, super, text-top, text-bottom, <length> and
- /// <percentage> "do not apply to cells; the cell is aligned at the baseline instead".
- /// https://www.w3.org/TR/CSS22/tables.html#height-layout
- fn cell_is_baseline_aligned(style: &StyleValues<'_>) -> bool {
- !style.vertical_align_is_keyword()
- || !matches!(
- style.vertical_align_keyword(),
- vertical_align::TOP | vertical_align::MIDDLE | vertical_align::BOTTOM
- )
+ cell_box.border_box_top(collapsed) + layout.content_baselines.first.unwrap_or(cell_box.content_block_size)
}
/// Notes what a cell contributes to the baseline of its row (see row_baseline) and to the row's height (see
@@ -3001,7 +2964,7 @@ impl<'pass> TableFormattingContext<'pass> {
let block_end_offset = cell_box.border_box_bottom(collapsed);
let block_size = cell_box.border_box_block_size(collapsed);
let row = &mut self.rows[cell.row_index];
- if Self::cell_is_baseline_aligned(style) {
+ if box_alignment::cell_alignment(*style) == box_alignment::CellAlignment::Baseline {
row.baseline = Some(
row.baseline
.map_or(cell.baseline, |baseline| baseline.max(cell.baseline)),
@@ -3017,48 +2980,6 @@ impl<'pass> TableFormattingContext<'pass> {
);
}
- /// Measures a cell's content ahead of its committing layout, with everything that layout will be handed but the
- /// intrinsic block padding, so that the committing run of the cell can replay the measuring one (see
- /// table_cell_run_shape_ahead_of_its_intrinsic_block_padding).
- fn measure_cell(
- &self,
- run: &FormattingContextRun<'pass>,
- cell_index: usize,
- inner: AvailableSpace,
- adopt_automatic_content_block_size: bool,
- ) -> Option<TableCellMeasurement> {
- let cell = self.cells[cell_index];
- let facts = NodeFacts::new(&self.run.pass, cell.box_);
- if !facts.can_have_children() {
- return None;
- }
- let shape = formatting_context::table_cell_run_shape_ahead_of_its_intrinsic_block_padding(
- run,
- &self.table_box_cells,
- cell.box_,
- self.cell_layouts[cell_index].box_cells,
- LayoutInput {
- available_space: inner,
- containing_block_constraints: ContainingBlockConstraints::default(),
- sizing: RootSizingDirectives {
- content_block_size_after_run: if adopt_automatic_content_block_size {
- geometry::ContentBlockSizeAfterRun::Automatic
- } else {
- geometry::ContentBlockSizeAfterRun::HandedOver
- },
- ..RootSizingDirectives::default()
- },
- participation: ParticipationInParentFormattingContext::Item,
- },
- );
- let result = formatting_context::lay_out_shape_for_its_result(run.pass, shape);
- Some(TableCellMeasurement {
- automatic_content_block_size: result.automatic_content_block_size,
- baselines: result.baselines,
- depends_on_percentage_block_size: result.depends_on_percentage_block_size,
- })
- }
-
fn compute_table_block_size(&mut self, run: &FormattingContextRun<'pass>) {
// First pass of row block-size calculation:
for row_index in 0..self.rows.len() {
@@ -3126,31 +3047,19 @@ impl<'pass> TableFormattingContext<'pass> {
cell_inline_size - cell_box.border_box_left(collapsed) - cell_box.border_box_right(collapsed),
);
- let outer_space = self.available_space;
- let inner = cell_box.available_inner_space_or_constraints_from(outer_space);
- self.cell_layouts[cell_index].inside_layout_input = inner;
- self.cell_layouts[cell_index].pre_layout_content_block_size = cell_box.content_block_size;
- self.cell_layouts[cell_index].box_cells = cell_box;
- let defer_inside_layout = style.height().is_percentage()
- || style.vertical_align_is_keyword()
- || self.anonymous_cell_wraps_flex_or_grid(cell);
- self.cell_layouts[cell_index].defers_inside_layout = defer_inside_layout;
- let mut content_baselines = None;
- if defer_inside_layout {
- // This cell's final inside layout happens once row heights are final; measure its
- // content ahead of its intrinsic padding instead of laying out the committing state twice.
- if let Some(measured) = self.measure_cell(run, cell_index, inner, true) {
- self.cell_layouts[cell_index].measurement = Some(measured);
- self.cell_layouts[cell_index]
- .box_cells
- .set_content_block_size(measured.automatic_content_block_size);
- content_baselines = Some(measured.baselines);
- }
- } else {
- let (baselines, fragment_arrival) = self.layout_inside_cell(run, cell_index, inner, true);
- self.keep_fragment_arrival_of_cell(cell_index, fragment_arrival);
- content_baselines = Some(baselines);
- }
+ let inner = cell_box.available_inner_space_or_constraints_from(self.available_space);
+ let layout = &mut self.cell_layouts[cell_index];
+ layout.inside_layout_input = inner;
+ layout.pre_layout_content_block_size = cell_box.content_block_size;
+ layout.box_cells = cell_box;
+ self.layout_inside_cell(
+ run,
+ cell_index,
+ RootSizingDirectives {
+ content_block_size_after_run: geometry::ContentBlockSizeAfterRun::Automatic,
+ ..RootSizingDirectives::default()
+ },
+ );
let cell_box = self.cell_layouts[cell_index].box_cells;
if self.needs_fixed_mode_row_measurement {
let min_size = style.min_height().to_px(participant_block_basis);
@@ -3159,8 +3068,7 @@ impl<'pass> TableFormattingContext<'pass> {
self.cells[cell_index].outer_min_block_size = measured;
self.cells[cell_index].outer_max_block_size = measured;
}
- let baseline = self.cell_baseline(cell_index, content_baselines);
- self.cells[cell_index].baseline = baseline;
+ self.cells[cell_index].baseline = self.cell_baseline(cell_index);
// Implements https://www.w3.org/TR/css-tables-3/#computing-the-table-height
// The minimum block size of a row is the maximum of:
@@ -3283,13 +3191,10 @@ impl<'pass> TableFormattingContext<'pass> {
let inner = cell_box.available_inner_space_or_constraints_from(self.available_space);
self.cell_layouts[cell_index].inside_layout_input = inner;
self.cell_layouts[cell_index].box_cells = cell_box;
- // The first pass measured this cell at its automatic block size; measure it again at
- // the percentage-resolved size to preserve the baseline its final inside layout will use.
- let content_baselines = self
- .measure_cell(run, cell_index, inner, false)
- .map(|measured| measured.baselines);
- let baseline = self.cell_baseline(cell_index, content_baselines);
- self.cells[cell_index].baseline = baseline;
+ // The first pass laid this cell out at its automatic block size; lay it out again at the
+ // percentage-resolved size, which it keeps.
+ self.layout_inside_cell(run, cell_index, RootSizingDirectives::default());
+ self.cells[cell_index].baseline = self.cell_baseline(cell_index);
if !self.rows[cell.row_index].is_collapsed {
let border_size = cell_box.border_box_block_size(collapsed);
self.rows[cell.row_index].reference_block_size =
@@ -3301,7 +3206,7 @@ impl<'pass> TableFormattingContext<'pass> {
}
/// Makes each row at least as tall as its baseline-aligned cells reach once they are aligned. A cell whose
- /// baseline lies above the row's baseline is moved down to it (see cell_intrinsic_block_padding), so the row must
+ /// baseline lies above the row's baseline is moved down to it (see cell_contents_block_offset), so the row must
/// hold the row's baseline plus the largest descent below it: "First the cells that are aligned on their baseline
/// are positioned. This will establish the baseline of the row. [...] The row now has a top, possibly a baseline,
/// and a provisional height, which is the distance from the top to the lowest bottom of the cells positioned so
@@ -3519,109 +3424,63 @@ impl<'pass> TableFormattingContext<'pass> {
self.table_block_size = self.table_block_size.max(total);
}
- fn layout_deferred_cells_inside(&mut self, run: &FormattingContextRun<'pass>) {
- // Deferred cells get their one and only committing inside layout here, once row
- // block sizes are final.
+ /// Stretches each cell to the rows it spans and aligns its contents in them: the table moves the contents as it
+ /// places the cell, or, where the cell's run laid out the absolutely positioned boxes the cell contains, lays the
+ /// cell out again at its stretched size with its contents moved, for those boxes to be laid out against it.
+ fn stretch_cells_to_their_rows(&mut self, run: &FormattingContextRun<'pass>) {
let collapsed = self.style(self.run.box_).border_collapse() != BORDER_COLLAPSE_SEPARATE;
for cell_index in 0..self.cells.len() {
- if !self.cell_layouts[cell_index].defers_inside_layout {
- continue;
- }
let cell = self.cells[cell_index];
- let adopt_automatic_content_block_size = !self.cell_has_resolvable_percentage_block_size(cell.box_);
- let intrinsic_block_padding = self.cell_intrinsic_block_padding(cell_index, collapsed);
- let measured_content_block_size = self.cell_layouts[cell_index].box_cells.content_block_size;
- if let Some(measurement) = self.cell_layouts[cell_index].measurement
- && run.fragments.is_none()
- && self.style(cell.box_).height().is_auto()
- && !self.node_facts(cell.box_).is_anonymous()
- && !measurement.depends_on_percentage_block_size
+ let laid_out = self.cell_layouts[cell_index].box_cells;
+ let free_space = self.compute_row_content_block_size(cell) - laid_out.border_box_block_size(collapsed);
+ let contents_block_offset = self.cell_contents_block_offset(cell_index, free_space);
+ let stretched_content_block_size = laid_out.content_block_size + free_space;
+ let layout = &mut self.cell_layouts[cell_index];
+ if !layout.run_laid_out_abspos_contained_by_cell
+ || (free_space == CssPixels::default() && contents_block_offset == CssPixels::default())
{
- // A measurement exports table sizes and row baselines, with no descendant
- // fragments. Row sizing has already consumed this cell's measured height and
- // baselines. Apply the final alignment padding without laying out its contents
- // again. Keep percentage-height cells and anonymous flex/grid wrappers on the
- // full path until their final-input dependencies are accounted for.
- let cell_box = &mut self.cell_layouts[cell_index].box_cells;
- cell_box.padding_top += intrinsic_block_padding.0;
- cell_box.padding_bottom += intrinsic_block_padding.1;
- self.cell_layouts[cell_index].placed =
- Some(formatting_context::PlacedChild::new(fragment_tree::FragmentGeometry {
- cells: *cell_box,
- line_data: None,
- }));
- self.cell_layouts[cell_index].content_baselines_of_handed_back_box = Some(measurement.baselines);
- formatting_context::propagate_percentage_block_size_dependency_to_containing_block(
- run.state,
- &run.pass,
- cell.box_,
- measurement.depends_on_percentage_block_size,
- );
+ layout.box_cells.set_content_block_size(stretched_content_block_size);
+ layout.contents_block_offset = contents_block_offset;
continue;
}
- // The first pass adopted the measured automatic block size so row sizing could read
- // it; restore the pre-layout size so the cell's children resolve percentages against
- // the same basis the measurement saw.
- let pre_layout_content_block_size = self.cell_layouts[cell_index].pre_layout_content_block_size;
- let cell_box = &mut self.cell_layouts[cell_index].box_cells;
- cell_box.set_content_block_size(pre_layout_content_block_size);
- cell_box.padding_top += intrinsic_block_padding.0;
- cell_box.padding_bottom += intrinsic_block_padding.1;
- let inner = self.cell_layouts[cell_index].inside_layout_input;
- let (_, fragment_arrival) =
- self.layout_inside_cell(run, cell_index, inner, adopt_automatic_content_block_size);
- self.keep_fragment_arrival_of_cell(cell_index, fragment_arrival);
- if adopt_automatic_content_block_size {
- debug_assert_eq!(
- self.cell_layouts[cell_index].box_cells.content_block_size, measured_content_block_size,
- "measured and committed automatic block sizes diverged"
- );
- }
+ layout
+ .box_cells
+ .set_content_block_size(layout.pre_layout_content_block_size);
+ self.layout_inside_cell(
+ run,
+ cell_index,
+ RootSizingDirectives {
+ content_block_size_after_run: geometry::ContentBlockSizeAfterRun::Given(
+ stretched_content_block_size,
+ ),
+ table_cell_contents_block_offset: contents_block_offset,
+ ..RootSizingDirectives::default()
+ },
+ );
}
}
- fn cell_intrinsic_block_padding(&mut self, cell_index: usize, collapsed: bool) -> (CssPixels, CssPixels) {
+ /// How far the contents of the cell at `cell_index` move down to align them in the rows it spans, which leave
+ /// `free_space` beside its border box.
+ fn cell_contents_block_offset(&self, cell_index: usize, free_space: CssPixels) -> CssPixels {
let cell = self.cells[cell_index];
- let row_size = self.compute_row_content_block_size(cell);
- let used = self.cell_layouts[cell_index].box_cells;
- let style = self.style(cell.box_);
- // When a table cell is an anonymous wrapper around a flex or grid container (e.g., a <td> with display:flex is
- // wrapped in an anonymous table-cell box per CSS Tables 3), the cell should be aligned to the top. This allows
- // the flex/grid container to fill the cell and handle alignment of its children via its own properties.
+ // An anonymous cell around a flex or grid container (such as a <td> with display: flex, which CSS Tables 3
+ // wraps in one) aligns the container at its top, so that the container aligns its children itself.
if self.anonymous_cell_wraps_flex_or_grid(cell) {
- return (CssPixels::default(), row_size - used.border_box_block_size(collapsed));
+ return CssPixels::default();
}
- // The following image shows various alignment lines of a row:
- // https://www.w3.org/TR/css-tables-3/images/cell-align-explainer.png
- // https://drafts.csswg.org/css2/#height-layout
- // In the context of tables, values for vertical-align have the following meanings:
- if Self::cell_is_baseline_aligned(&style) {
+ match box_alignment::cell_alignment(self.style(cell.box_)) {
// The baseline of the cell is put at the same height as the baseline of the first of the rows it spans.
- let padding_top = self.rows[cell.row_index].baseline.unwrap_or(cell.baseline) - cell.baseline;
- return (
- padding_top,
- row_size - (used.border_box_block_size(collapsed) + padding_top),
- );
- }
- match style.vertical_align_keyword() {
- vertical_align::MIDDLE => {
- // The center of the cell is aligned with the center of the rows it spans.
- let difference = row_size - used.border_box_block_size(collapsed);
- (difference / 2, difference / 2)
+ box_alignment::CellAlignment::Baseline => {
+ self.rows[cell.row_index].baseline.unwrap_or(cell.baseline) - cell.baseline
}
- vertical_align::TOP => {
- // The top of the cell box is aligned with the top of the first row it spans.
- (CssPixels::default(), row_size - used.border_box_block_size(collapsed))
+ box_alignment::CellAlignment::Content(alignment) => {
+ alignment.offset(free_space, box_alignment::OverflowSafety::Safe)
}
- vertical_align::BOTTOM => {
- // The bottom of the cell box is aligned with the bottom of the last row it spans.
- (row_size - used.border_box_block_size(collapsed), CssPixels::default())
- }
- _ => unreachable!("every other value aligns the cell at the baseline"),
}
}
- fn compute_row_content_block_size(&mut self, cell: TableCell) -> CssPixels {
+ fn compute_row_content_block_size(&self, cell: TableCell) -> CssPixels {
// The block size of a cell is the sum of all spanned rows, as described in
// https://www.w3.org/TR/css-tables-3/#bounding-box-assignment
let first = &self.row_boxes[cell.row_index].cells;
@@ -3684,7 +3543,6 @@ impl<'pass> TableFormattingContext<'pass> {
// - the border spacing after each visible column before the cell (in its column's offset)
let x = row_content_offset.x + cell_box.border_box_left(collapsed) + self.column_offsets[cell.column_index];
let y = row_content_offset.y + cell_box.border_box_top(collapsed);
- let fragment_arrival = self.cell_layouts[cell_index].fragment_arrival.take();
// A relatively positioned cell is offset from where the table places it, as any in-flow box is.
let insets = abspos_engine::compute_inset_native(
&self.run,
@@ -3693,19 +3551,23 @@ impl<'pass> TableFormattingContext<'pass> {
inset_percentage_basis,
percentage_block_insets_have_definite_basis,
);
- let placed_cell = self.cell_layouts[cell_index]
- .placed
- .take()
- .expect("a cell is laid out before it is placed")
- .with_fragment_facts(self.cell_layouts[cell_index].fragment_facts)
- .with_in_flow_box_insets(insets);
+ let layout = &mut self.cell_layouts[cell_index];
+ let mut placed_cell = layout.placed.take().expect("a cell is laid out before it is placed");
+ placed_cell.geometry.cells = cell_box;
+ let placed_cell = placed_cell
+ .with_fragment_facts(layout.fragment_facts)
+ .with_in_flow_box_insets(insets)
+ .with_contents_shift(FfiCssPixelPoint {
+ x: CssPixels::default(),
+ y: layout.contents_block_offset,
+ });
formatting_context::place_child(
&self.run,
cell.box_,
placed_cell,
FfiCssPixelPoint { x, y },
None,
- fragment_arrival,
+ layout.fragment_arrival.take(),
);
}
}
@@ -3885,7 +3747,7 @@ impl<'pass> TableFormattingContext<'pass> {
self.compute_table_block_size(run);
self.distribute_block_size_to_rows();
self.position_row_boxes();
- self.layout_deferred_cells_inside(run);
+ self.stretch_cells_to_their_rows(run);
self.position_cell_boxes();
self.position_column_boxes();
self.materialize_collapsed_table_borders();
diff --git a/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row-group.txt b/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row-group.txt
index 925d9307b71..de3aa6be690 100644
--- a/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row-group.txt
+++ b/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row-group.txt
@@ -8,12 +8,12 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
BlockContainer <div.abspos> at [8,8] positioned [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <div.row> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 16 14+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [8,8 36.03125x16] baseline: 13
"first"
TextNode <#text> (not painted)
Box <div.row> at [8,38] table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,38] table-cell [0+0+0 200 0+0+0] [0+0+0 16 14+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,38] table-cell [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [8,38 54.78125x16] baseline: 13
"second"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row.txt b/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row.txt
index 6d287335b5e..ca0817cd496 100644
--- a/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row.txt
+++ b/Tests/LibWeb/Layout/expected/abspos-direct-child-of-relative-table-row.txt
@@ -4,15 +4,15 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 200 0+0+584] [0+0+0 60 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 60 0+0+0] [TFC] children: not-inline
Box <div.row> at [8,8] positioned table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 79.359375 0+0+0] [0+0+0 16 14+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 79.359375 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [8,8 36.03125x16] baseline: 13
"first"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [87.359375,23] table-cell [0+0+0 120.640625 0+0+0] [0+0+15 0 15+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [87.359375,8] table-cell [0+0+0 120.640625 0+0+0] [0+0+0 30 0+0+0] [BFC] children: not-inline
Box <div.row> at [8,38] positioned table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,51] table-cell [0+0+0 79.359375 0+0+0] [0+0+13 0 17+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,38] table-cell [0+0+0 79.359375 0+0+0] [0+0+0 30 0+0+0] [BFC] children: not-inline
BlockContainer <div.abspos> at [18,43] positioned [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
- BlockContainer <div.cell> at [87.359375,38] table-cell [0+0+0 120.640625 0+0+0] [0+0+0 16 14+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [87.359375,38] table-cell [0+0+0 120.640625 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [87.359375,38 54.78125x16] baseline: 13
"second"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/abspos-in-cell-relative-to-relative-table.txt b/Tests/LibWeb/Layout/expected/abspos-in-cell-relative-to-relative-table.txt
index 2fa58c46317..3ade61a6fed 100644
--- a/Tests/LibWeb/Layout/expected/abspos-in-cell-relative-to-relative-table.txt
+++ b/Tests/LibWeb/Layout/expected/abspos-in-cell-relative-to-relative-table.txt
@@ -5,12 +5,12 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 60 0+0+0] [TFC] children: not-inline
Box <tbody> at [8,8] table-row-group [0+0+0 200 0+0+0] [0+0+0 60 0+0+0] children: not-inline
Box <tr> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <td> at [8,15] table-cell [0+0+0 200 0+0+0] [0+0+7 16 7+0+0] [BFC] children: inline
+ BlockContainer <td> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [8,15 36.03125x16] baseline: 13
"first"
TextNode <#text> (not painted)
Box <tr> at [8,38] table-row [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <td> at [8,45] table-cell [0+0+0 200 0+0+0] [0+0+7 16 7+0+0] [BFC] children: inline
+ BlockContainer <td> at [8,38] table-cell [0+0+0 200 0+0+0] [0+0+0 30 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [8,45 54.78125x16] baseline: 13
"second"
BlockContainer <div.abspos> at [20,16] positioned [0+0+0 40 0+0+0] [0+0+0 16 0+0+0] [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 2e8c3a82f13..b5f7792c4be 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
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [11,11] table-box [0+1+0 108 0+1+0] [0+1+0 108 0+1+0] [TFC] children: not-inline
Box <tbody> at [13,13] table-row-group [0+0+0 104 0+0+0] [0+0+0 104 0+0+0] children: not-inline
Box <tr> at [13,13] table-row [0+0+0 104 0+0+0] [0+0+0 104 0+0+0] children: not-inline
- BlockContainer <td> at [15,64] table-cell [0+1+1 100 1+1+0] [0+1+50 2 50+1+0] [BFC] children: not-inline
+ BlockContainer <td> at [15,15] table-cell [0+1+1 100 1+1+0] [0+1+1 100 1+1+0] [BFC] children: not-inline
BlockContainer <(anonymous)> at [16,65] [0+1+0 98 0+1+0] [0+1+0 0 0+1+0] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/css-table-cell-verticalalign-text-top.txt b/Tests/LibWeb/Layout/expected/css-table-cell-verticalalign-text-top.txt
index 7b13b84e87b..0a84623edef 100644
--- a/Tests/LibWeb/Layout/expected/css-table-cell-verticalalign-text-top.txt
+++ b/Tests/LibWeb/Layout/expected/css-table-cell-verticalalign-text-top.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 203 0+1+0] [0+1+0 103 0+1+0] [TFC] children: not-inline
Box <tbody> at [9,9] table-row-group [0+0+0 203 0+0+0] [0+0+0 103 0+0+0] children: not-inline
Box <tr> at [9,9] table-row [0+0+0 203 0+0+0] [0+0+0 103 0+0+0] children: not-inline
- BlockContainer <td> at [10,10] table-cell [0+1+1 200 1+1+0] [0+1+1 16 85+1+0] [BFC] children: inline
+ BlockContainer <td> at [10,10] table-cell [0+1+1 200 1+1+0] [0+1+1 100 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 15, rect: [10,10 129.296875x16] baseline: 13
"Text at the top"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/flex/table-flex-item-stretch.txt b/Tests/LibWeb/Layout/expected/flex/table-flex-item-stretch.txt
index fe30897ac82..3c837b33755 100644
--- a/Tests/LibWeb/Layout/expected/flex/table-flex-item-stretch.txt
+++ b/Tests/LibWeb/Layout/expected/flex/table-flex-item-stretch.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] flex-item [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] [TFC] children: not-inline
Box <(anonymous)> at [8,8] table-row [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,46.5] table-cell [0+0+0 20 0+0+0] [0+0+38.5 23 38.5+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] [BFC] children: inline
frag 0 from BlockContainer start: 0, length: 0, rect: [8,46.5 20x20] baseline: 20
BlockContainer <span.content> at [8,46.5] inline-block [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
BlockContainer <div.sizer> at [28,8] flex-item [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
@@ -14,7 +14,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <div.table> at [8,128] table-box [0+0+0 20 0+0+0] [0+0+0 80 0+0+0] [TFC] children: not-inline
BlockContainer <div.caption> at [8,108] [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <(anonymous)> at [8,128] table-row [0+0+0 20 0+0+0] [0+0+0 80 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,156.5] table-cell [0+0+0 20 0+0+0] [0+0+28.5 23 28.5+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,128] table-cell [0+0+0 20 0+0+0] [0+0+0 80 0+0+0] [BFC] children: inline
frag 0 from BlockContainer start: 0, length: 0, rect: [8,156.5 20x20] baseline: 20
BlockContainer <span.content> at [8,156.5] inline-block [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
BlockContainer <div.sizer> at [28,108] flex-item [0+0+0 20 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
diff --git a/Tests/LibWeb/Layout/expected/table-fixup-with-rowspan.txt b/Tests/LibWeb/Layout/expected/table-fixup-with-rowspan.txt
index 6ccb9c363d8..9e120700b80 100644
--- a/Tests/LibWeb/Layout/expected/table-fixup-with-rowspan.txt
+++ b/Tests/LibWeb/Layout/expected/table-fixup-with-rowspan.txt
@@ -9,7 +9,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [11,11 6.34375x16] baseline: 13
"1"
TextNode <#text> (not painted)
- BlockContainer <td> at [24.09375,22] table-cell [0+0+1 8.8125 1+0+0] [0+0+12 16 12+0+0] [BFC] children: inline
+ BlockContainer <td> at [24.09375,11] table-cell [0+0+1 8.8125 1+0+0] [0+0+1 38 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [24.09375,22 8.8125x16] baseline: 13
"2"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/abspos-table-inside-abspos-table.txt b/Tests/LibWeb/Layout/expected/table/abspos-table-inside-abspos-table.txt
index eef20065267..1a91751446d 100644
--- a/Tests/LibWeb/Layout/expected/table/abspos-table-inside-abspos-table.txt
+++ b/Tests/LibWeb/Layout/expected/table/abspos-table-inside-abspos-table.txt
@@ -4,7 +4,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] positioned [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
Box <div#outer> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [TFC] children: not-inline
Box <(anonymous)> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 0 100+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
TableWrapper <(anonymous)> at [58,18] positioned [0+0+0 9.703125 0+0+0] [0+0+0 16 0+0+0] [BFC] children: not-inline
Box <div#inner> at [58,18] table-box [0+0+0 9.703125 0+0+0] [0+0+0 16 0+0+0] [TFC] children: not-inline
Box <(anonymous)> at [58,18] table-row [0+0+0 9.703125 0+0+0] [0+0+0 16 0+0+0] children: not-inline
diff --git a/Tests/LibWeb/Layout/expected/table/acid2-reduction.txt b/Tests/LibWeb/Layout/expected/table/acid2-reduction.txt
index 519d7ac1aac..e6227d1b37f 100644
--- a/Tests/LibWeb/Layout/expected/table/acid2-reduction.txt
+++ b/Tests/LibWeb/Layout/expected/table/acid2-reduction.txt
@@ -7,7 +7,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 50 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
TableWrapper <(anonymous)> at [8,8] [0+0+0 50 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
Box <div.second-part> at [8,8] table-box [0+0+0 50 0+0+0] [0+0+0 50 0+0+0] [TFC] children: not-inline
- BlockContainer <div.third-part> at [58,58] table-cell [0+0+0 50 0+0+0] [0+0+50 0 0+0+0] [BFC] children: not-inline
+ BlockContainer <div.third-part> at [58,8] table-cell [0+0+0 50 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x66] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/align-top-and-bottom.txt b/Tests/LibWeb/Layout/expected/table/align-top-and-bottom.txt
index 7e8bfc89c1a..9a0d1dd60e9 100644
--- a/Tests/LibWeb/Layout/expected/table/align-top-and-bottom.txt
+++ b/Tests/LibWeb/Layout/expected/table/align-top-and-bottom.txt
@@ -5,11 +5,11 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 195.328125 0+1+0] [0+1+0 94 0+1+0] [TFC] children: not-inline
Box <tbody> at [9,9] table-row-group [0+0+0 195.328125 0+0+0] [0+0+0 94 0+0+0] children: not-inline
Box <tr> at [9,9] table-row [0+0+0 195.328125 0+0+0] [0+0+0 47 0+0+0] children: not-inline
- BlockContainer <td> at [24,24] table-cell [0+1+15 32.078125 15+1+0] [0+1+15 16 62+1+0] [BFC] children: inline
+ BlockContainer <td> at [24,24] table-cell [0+1+15 32.078125 15+1+0] [0+1+15 63 15+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [24,24 32.078125x16] baseline: 13
"Top"
TextNode <#text> (not painted)
- BlockContainer <td> at [87.078125,71] table-cell [0+1+15 55.984375 15+1+0] [0+1+62 16 15+1+0] [BFC] children: inline
+ BlockContainer <td> at [87.078125,24] table-cell [0+1+15 55.984375 15+1+0] [0+1+15 63 15+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [87.078125,71 55.984375x16] baseline: 13
"Bottom"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/baseline-aligned-cell-grows-row.txt b/Tests/LibWeb/Layout/expected/table/baseline-aligned-cell-grows-row.txt
index f0c2178b5e7..29779289a86 100644
--- a/Tests/LibWeb/Layout/expected/table/baseline-aligned-cell-grows-row.txt
+++ b/Tests/LibWeb/Layout/expected/table/baseline-aligned-cell-grows-row.txt
@@ -5,9 +5,9 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [8,8] table-box [0+0+0 40 0+0+0] [0+0+0 150 0+0+0] [TFC] children: not-inline
Box <tbody> at [8,8] table-row-group [0+0+0 40 0+0+0] [0+0+0 150 0+0+0] children: not-inline
Box <tr> at [8,8] table-row [0+0+0 40 0+0+0] [0+0+0 150 0+0+0] children: not-inline
- BlockContainer <td> at [8,8] table-cell [0+0+0 20 0+0+0] [0+0+0 50 100+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [8,8] table-cell [0+0+0 20 0+0+0] [0+0+0 150 0+0+0] [BFC] children: not-inline
BlockContainer <div> at [8,8] [0+0+0 20 0+0+0] [0+0+0 50 0+0+0] children: not-inline
- BlockContainer <td> at [28,38] table-cell [0+0+0 20 0+0+0] [0+0+30 120 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [28,8] table-cell [0+0+0 20 0+0+0] [0+0+0 150 0+0+0] [BFC] children: not-inline
BlockContainer <(anonymous)> at [28,38] [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] children: inline
frag 0 from BlockContainer start: 0, length: 0, rect: [28,38 20x20] baseline: 20
BlockContainer <span.inline> at [28,38] inline-block [0+0+0 20 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
diff --git a/Tests/LibWeb/Layout/expected/table/border-conflict-resolution-with-cell.txt b/Tests/LibWeb/Layout/expected/table/border-conflict-resolution-with-cell.txt
index e20c3419acf..f6abaff2720 100644
--- a/Tests/LibWeb/Layout/expected/table/border-conflict-resolution-with-cell.txt
+++ b/Tests/LibWeb/Layout/expected/table/border-conflict-resolution-with-cell.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,11] table-box [0+1+0 169.671875 0+5+0] [0+5+0 82 0+5+0] [TFC] children: not-inline
Box <tbody> at [9,11] table-row-group [0+0+0 169.671875 0+0+0] [0+0+0 82 0+0+0] children: not-inline
Box <tr> at [9,11] table-row [0+0+0 169.671875 0+0+0] [0+0+0 41 0+0+0] children: not-inline
- BlockContainer <td> at [29,23] table-cell [0+1+20 14.265625 20+5+0] [0+1+12 16 12+1+0] [BFC] children: inline
+ BlockContainer <td> at [29,21] table-cell [0+1+20 14.265625 20+5+0] [0+1+10 20 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [29,23 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
@@ -13,16 +13,16 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [88.265625,23 9.34375x16] baseline: 13
"B"
TextNode <#text> (not painted)
- BlockContainer <td> at [143.125,22] table-cell [0+5+20 14.546875 20+1+0] [0+1+11 16 11+5+0] [BFC] children: inline
+ BlockContainer <td> at [143.125,21] table-cell [0+5+20 14.546875 20+1+0] [0+1+10 18 10+5+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [143.125,22 10.3125x16] baseline: 13
"C"
TextNode <#text> (not painted)
Box <tr> at [9,52] table-row [0+0+0 169.671875 0+0+0] [0+0+0 41 0+0+0] children: not-inline
- BlockContainer <td> at [29,64] table-cell [0+1+20 16.265625 20+1+0] [0+1+12 16 12+1+0] [BFC] children: inline
+ BlockContainer <td> at [29,62] table-cell [0+1+20 16.265625 20+1+0] [0+1+10 20 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [29,64 11.140625x16] baseline: 13
"D"
TextNode <#text> (not painted)
- BlockContainer <td> at [86.265625,65] table-cell [0+1+20 11.859375 20+5+0] [0+5+11 16 11+1+0] [BFC] children: inline
+ BlockContainer <td> at [86.265625,64] table-cell [0+1+20 11.859375 20+5+0] [0+5+10 18 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [86.265625,65 11.859375x16] baseline: 13
"E"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt b/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt
index db3d88c4b47..8e7c314be78 100644
--- a/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt
+++ b/Tests/LibWeb/Layout/expected/table/border-spacing-rowspan.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 241.90625 0+1+0] [0+1+0 250 0+1+0] [TFC] children: not-inline
Box <tbody> at [29,19] table-row-group [0+0+0 201.90625 0+0+0] [0+0+0 230 0+0+0] children: not-inline
Box <tr> at [29,19] table-row [0+0+0 201.90625 0+0+0] [0+0+0 38 0+0+0] children: not-inline
- BlockContainer <td> at [50,54] table-cell [0+1+20 14.265625 20+1+0] [0+1+34 16 34+1+0] [BFC] children: inline
+ BlockContainer <td> at [50,30] table-cell [0+1+20 14.265625 20+1+0] [0+1+10 64 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [50,54 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/cell-px-height.txt b/Tests/LibWeb/Layout/expected/table/cell-px-height.txt
index cbde1f1c87e..689ad1a8895 100644
--- a/Tests/LibWeb/Layout/expected/table/cell-px-height.txt
+++ b/Tests/LibWeb/Layout/expected/table/cell-px-height.txt
@@ -3,7 +3,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [8+0+0 102 0+0+690] [8+0+0 102 0+0+8] [BFC] children: not-inline
Box <body> at [8,8] table-box [0+0+0 102 0+0+0] [0+0+0 102 0+0+0] [TFC] children: not-inline
Box <div.row> at [8,8] table-row [0+0+0 102 0+0+0] [0+0+0 102 0+0+0] children: not-inline
- BlockContainer <div.cell> at [9,9] table-cell [0+1+0 100 0+1+0] [0+1+0 0 100+1+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [9,9] table-cell [0+1+0 100 0+1+0] [0+1+0 100 0+1+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x118] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/clip-spans-to-table-end.txt b/Tests/LibWeb/Layout/expected/table/clip-spans-to-table-end.txt
index 7344e28fd70..30c1c2970f6 100644
--- a/Tests/LibWeb/Layout/expected/table/clip-spans-to-table-end.txt
+++ b/Tests/LibWeb/Layout/expected/table/clip-spans-to-table-end.txt
@@ -17,13 +17,13 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [78.265625,19 9.09375x16] baseline: 13
"3"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [98.359375,27.5] table-cell [0+0+0 0 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [98.359375,9] table-cell [0+0+0 0 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
Box <tr> at [9,46] table-row [0+0+0 89.359375 0+0+0] [0+0+0 37 0+0+0] children: not-inline
BlockContainer <td> at [19,56] table-cell [0+1+10 8.453125 10+1+0] [0+1+10 16 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [19,56 7.75x16] baseline: 13
"4"
TextNode <#text> (not painted)
- BlockContainer <td> at [48.453125,74.5] table-cell [0+1+10 38.90625 10+1+0] [0+1+28.5 16 28.5+1+0] [BFC] children: inline
+ BlockContainer <td> at [48.453125,56] table-cell [0+1+10 38.90625 10+1+0] [0+1+10 53 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [48.453125,74.5 24.046875x16] baseline: 13
"6-9"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/col-percentage-width.txt b/Tests/LibWeb/Layout/expected/table/col-percentage-width.txt
index 27219b2563f..4b8f3c52a3a 100644
--- a/Tests/LibWeb/Layout/expected/table/col-percentage-width.txt
+++ b/Tests/LibWeb/Layout/expected/table/col-percentage-width.txt
@@ -8,8 +8,8 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <col> at [108,8] [0+0+0 300 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tbody> at [8,8] table-row-group [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tr> at [8,8] table-row [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <td> at [8,13] table-cell [0+0+0 100 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [108,13] table-cell [0+0+0 300 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [8,8] table-cell [0+0+0 100 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [108,8] table-cell [0+0+0 300 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
TableWrapper <(anonymous)> at [8,18] [0+0+0 400 0+0+384] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <table#fixed> at [8,18] table-box [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] [TFC] children: not-inline
BlockContainer <colgroup> at [8,18] table-column-group [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] children: not-inline
@@ -17,8 +17,8 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <col> at [108,18] [0+0+0 300 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tbody> at [8,18] table-row-group [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tr> at [8,18] table-row [0+0+0 400 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <td> at [8,23] table-cell [0+0+0 100 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [108,23] table-cell [0+0+0 300 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [8,18] table-cell [0+0+0 100 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [108,18] table-cell [0+0+0 300 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x36] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/collapsed-borders-empty-row.txt b/Tests/LibWeb/Layout/expected/table/collapsed-borders-empty-row.txt
index 964898d190e..66e192e503e 100644
--- a/Tests/LibWeb/Layout/expected/table/collapsed-borders-empty-row.txt
+++ b/Tests/LibWeb/Layout/expected/table/collapsed-borders-empty-row.txt
@@ -5,17 +5,17 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [13,13] table-box [0+10+0 60 0+10+0] [0+10+0 64 0+10+0] [TFC] children: not-inline
Box <tbody> at [13,13] table-row-group [0+0+0 60 0+0+0] [0+0+0 64 0+0+0] children: not-inline
Box <tr> at [13,13] table-row [0+0+0 60 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <td> at [18,28] table-cell [0+10+0 20 0+10+0] [0+10+10 0 10+10+0] [BFC] children: not-inline
- BlockContainer <td> at [48,28] table-cell [0+10+0 20 0+10+0] [0+10+10 0 10+10+0] [BFC] children: not-inline
+ BlockContainer <td> at [18,18] table-cell [0+10+0 20 0+10+0] [0+10+0 20 0+10+0] [BFC] children: not-inline
+ BlockContainer <td> at [48,18] table-cell [0+10+0 20 0+10+0] [0+10+0 20 0+10+0] [BFC] children: not-inline
Box <tr> at [13,43] table-row [0+0+0 60 0+0+0] [0+0+0 0 0+0+0] children: not-inline
BlockContainer <(anonymous)> at [13,43] table-cell [0+0+0 30 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
BlockContainer <(anonymous)> at [43,43] table-cell [0+0+0 30 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
Box <tr.spacer> at [13,43] table-row [0+0+0 60 0+0+0] [0+0+0 4 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [13,45] table-cell [0+0+0 30 0+0+0] [0+0+2 0 2+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [43,45] table-cell [0+0+0 30 0+0+0] [0+0+2 0 2+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [13,43] table-cell [0+0+0 30 0+0+0] [0+0+0 4 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [43,43] table-cell [0+0+0 30 0+0+0] [0+0+0 4 0+0+0] [BFC] children: not-inline
Box <tr> at [13,47] table-row [0+0+0 60 0+0+0] [0+0+0 30 0+0+0] children: not-inline
- BlockContainer <td> at [18,62] table-cell [0+10+0 20 0+10+0] [0+10+10 0 10+10+0] [BFC] children: not-inline
- BlockContainer <td> at [48,62] table-cell [0+10+0 20 0+10+0] [0+10+10 0 10+10+0] [BFC] children: not-inline
+ BlockContainer <td> at [18,52] table-cell [0+10+0 20 0+10+0] [0+10+0 20 0+10+0] [BFC] children: not-inline
+ BlockContainer <td> at [48,52] table-cell [0+10+0 20 0+10+0] [0+10+0 20 0+10+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x90] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/colspan-overflow-crash.txt b/Tests/LibWeb/Layout/expected/table/colspan-overflow-crash.txt
index 84cb3881c9b..99724b478c0 100644
--- a/Tests/LibWeb/Layout/expected/table/colspan-overflow-crash.txt
+++ b/Tests/LibWeb/Layout/expected/table/colspan-overflow-crash.txt
@@ -9,8 +9,8 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [11,11 6.34375x16] baseline: 13
"1"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [20.8125,19] table-cell [0+0+0 0 0+0+0] [0+0+9 0 9+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [22.8125,19] table-cell [0+0+0 11.09375 0+0+0] [0+0+9 0 9+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [20.8125,10] table-cell [0+0+0 0 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [22.8125,10] table-cell [0+0+0 11.09375 0+0+0] [0+0+0 18 0+0+0] [BFC] children: not-inline
Box <tr> at [10,30] table-row [0+0+0 23.90625 0+0+0] [0+0+0 18 0+0+0] children: not-inline
BlockContainer <td> at [11,31] table-cell [0+0+1 8.8125 1+0+0] [0+0+1 16 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [11,31 8.8125x16] baseline: 13
diff --git a/Tests/LibWeb/Layout/expected/table/column-boxes-geometry.txt b/Tests/LibWeb/Layout/expected/table/column-boxes-geometry.txt
index 3e3b8d3cadb..944b96be19a 100644
--- a/Tests/LibWeb/Layout/expected/table/column-boxes-geometry.txt
+++ b/Tests/LibWeb/Layout/expected/table/column-boxes-geometry.txt
@@ -11,25 +11,25 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
BlockContainer <colgroup> at [148,10] table-column-group [0+0+0 0 0+0+0] [0+0+0 34 0+0+0] children: not-inline
Box <thead> at [12,10] table-header-group [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tr> at [12,10] table-row [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <td> at [12,15] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [46,15] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [80,15] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [114,15] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [148,15] table-cell [0+0+0 0 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [12,10] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [46,10] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [80,10] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [114,10] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [148,10] table-cell [0+0+0 0 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <tbody> at [12,22] table-row-group [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tr> at [12,22] table-row [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <td> at [12,27] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [46,27] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [80,27] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [114,27] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [148,27] table-cell [0+0+0 0 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [12,22] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [46,22] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [80,22] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [114,22] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [148,22] table-cell [0+0+0 0 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <tfoot> at [12,34] table-footer-group [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <tr> at [12,34] table-row [0+0+0 136 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <td> at [12,39] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [46,39] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [80,39] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <td> at [114,39] table-cell [0+0+0 30 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [148,39] table-cell [0+0+0 0 0+0+0] [0+0+5 0 5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [12,34] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [46,34] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [80,34] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [114,34] table-cell [0+0+0 30 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [148,34] table-cell [0+0+0 0 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x54] (z-index: auto)
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 bccc8cd33a8..0d43203148d 100644
--- a/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt
+++ b/Tests/LibWeb/Layout/expected/table/columns-width-distribution-1.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table.ambox> at [9,9] table-box [0+1+0 782 0+1+0] [0+1+0 102 0+1+0] [TFC] children: not-inline
Box <tbody> at [11,11] table-row-group [0+0+0 778 0+0+0] [0+0+0 98 0+0+0] children: not-inline
Box <tr> at [11,11] table-row [0+0+0 778 0+0+0] [0+0+0 98 0+0+0] children: not-inline
- BlockContainer <td.mbox-image> at [12,35] table-cell [0+0+1 50 1+0+0] [0+0+24 50 24+0+0] [BFC] children: not-inline
+ BlockContainer <td.mbox-image> at [12,12] table-cell [0+0+1 50 1+0+0] [0+0+1 96 1+0+0] [BFC] children: not-inline
BlockContainer <div.mbox-image-div> at [12,35] [0+0+0 50 0+0+0] [0+0+0 50 0+0+0] children: not-inline
BlockContainer <td.mbox-text> at [66,12] table-cell [0+0+1 722 1+0+0] [0+0+1 96 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 1, length: 84, rect: [66,12 689.640625x16] baseline: 13
diff --git a/Tests/LibWeb/Layout/expected/table/inline-table-baseline.txt b/Tests/LibWeb/Layout/expected/table/inline-table-baseline.txt
index af4235ab4f1..7250f05eb17 100644
--- a/Tests/LibWeb/Layout/expected/table/inline-table-baseline.txt
+++ b/Tests/LibWeb/Layout/expected/table/inline-table-baseline.txt
@@ -64,11 +64,11 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table.table> at [28,163] inline-table table-box [0+0+0 28.90625 0+0+0] [0+0+0 40 0+0+0] [TFC] children: not-inline
Box <tbody> at [28,163] table-row-group [0+0+0 28.90625 0+0+0] [0+0+0 40 0+0+0] children: not-inline
Box <tr> at [28,163] table-row [0+0+0 28.90625 0+0+0] [0+0+0 40 0+0+0] children: not-inline
- BlockContainer <td.cell> at [28,173] table-cell [0+0+0 14.453125 0+0+0] [0+0+10 20 10+0+0] [BFC] children: inline
+ BlockContainer <td.cell> at [28,163] table-cell [0+0+0 14.453125 0+0+0] [0+0+0 40 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [28,173 14.453125x20] baseline: 16
"X"
TextNode <#text> (not painted)
- BlockContainer <td.cell> at [42.453125,163] table-cell [0+0+0 14.453125 0+0+0] [0+0+0 20 20+0+0] [BFC] children: inline
+ BlockContainer <td.cell> at [42.453125,163] table-cell [0+0+0 14.453125 0+0+0] [0+0+0 40 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [42.453125,163 14.453125x20] baseline: 16
"X"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/internal-alignment.txt b/Tests/LibWeb/Layout/expected/table/internal-alignment.txt
index b9e19d1ba02..416f7f7d099 100644
--- a/Tests/LibWeb/Layout/expected/table/internal-alignment.txt
+++ b/Tests/LibWeb/Layout/expected/table/internal-alignment.txt
@@ -6,7 +6,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [301,9] table-box [0+1+0 198 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [303,11] table-row-group [0+0+0 194 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [303,11] table-row [0+0+0 194 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [304,84] table-cell [0+0+1 192 1+0+0] [0+0+73 48 73+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [304,12] table-cell [0+0+1 192 1+0+0] [0+0+1 192 1+0+0] [BFC] children: not-inline
BlockContainer <p> at [304,100] [0+0+0 192 0+0+0] [16+0+0 16 0+0+16] children: inline
frag 0 from TextNode start: 0, length: 4, rect: [304,100 26.25x16] baseline: 13
"left"
diff --git a/Tests/LibWeb/Layout/expected/table/line-breaking-in-cells.txt b/Tests/LibWeb/Layout/expected/table/line-breaking-in-cells.txt
index 4d7b76ec8bd..653311021fa 100644
--- a/Tests/LibWeb/Layout/expected/table/line-breaking-in-cells.txt
+++ b/Tests/LibWeb/Layout/expected/table/line-breaking-in-cells.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 58 0+1+0] [0+1+0 35 0+1+0] [TFC] children: not-inline
Box <tbody> at [9,9] table-row-group [0+0+0 58 0+0+0] [0+0+0 35 0+0+0] children: not-inline
Box <tr> at [9,9] table-row [0+0+0 58 0+0+0] [0+0+0 35 0+0+0] children: not-inline
- BlockContainer <td> at [10,18] table-cell [0+1+1 14.40625 1+1+0] [0+1+9 16 9+1+0] [BFC] children: inline
+ BlockContainer <td> at [10,10] table-cell [0+1+1 14.40625 1+1+0] [0+1+1 32 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [10,18 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
@@ -17,7 +17,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TextNode <#text> (not painted)
BreakNode <br> (not painted)
TextNode <#text> (not painted)
- BlockContainer <td> at [50.59375,18] table-cell [0+1+1 14.40625 1+1+0] [0+1+9 16 9+1+0] [BFC] children: inline
+ BlockContainer <td> at [50.59375,10] table-cell [0+1+1 14.40625 1+1+0] [0+1+1 32 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 5, length: 1, rect: [50.59375,18 11.140625x16] baseline: 13
"D"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/missing-cells-with-span.txt b/Tests/LibWeb/Layout/expected/table/missing-cells-with-span.txt
index 80edbc672fc..2094ba4f79e 100644
--- a/Tests/LibWeb/Layout/expected/table/missing-cells-with-span.txt
+++ b/Tests/LibWeb/Layout/expected/table/missing-cells-with-span.txt
@@ -19,15 +19,15 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [19,56 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [62.21875,64.5] table-cell [0+0+0 22.890625 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [85.109375,64.5] table-cell [0+0+0 22.890625 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [62.21875,46] table-cell [0+0+0 22.890625 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [85.109375,46] table-cell [0+0+0 22.890625 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
Box <tr> at [9,83] table-row [0+0+0 99 0+0+0] [0+0+0 37 0+0+0] children: not-inline
BlockContainer <td> at [19,93] table-cell [0+1+10 32.21875 10+1+0] [0+1+10 16 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [19,93 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [62.21875,101.5] table-cell [0+0+0 22.890625 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
- BlockContainer <(anonymous)> at [85.109375,101.5] table-cell [0+0+0 22.890625 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [62.21875,83] table-cell [0+0+0 22.890625 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [85.109375,83] table-cell [0+0+0 22.890625 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x128] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/missing-cells.txt b/Tests/LibWeb/Layout/expected/table/missing-cells.txt
index 7d9e43952be..70888e6644c 100644
--- a/Tests/LibWeb/Layout/expected/table/missing-cells.txt
+++ b/Tests/LibWeb/Layout/expected/table/missing-cells.txt
@@ -19,13 +19,13 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [19,56 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [62.21875,64.5] table-cell [0+0+0 45.78125 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [62.21875,46] table-cell [0+0+0 45.78125 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
Box <tr> at [9,83] table-row [0+0+0 99 0+0+0] [0+0+0 37 0+0+0] children: not-inline
BlockContainer <td> at [19,93] table-cell [0+1+10 32.21875 10+1+0] [0+1+10 16 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [19,93 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
- BlockContainer <(anonymous)> at [62.21875,101.5] table-cell [0+0+0 45.78125 0+0+0] [0+0+18.5 0 18.5+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [62.21875,83] table-cell [0+0+0 45.78125 0+0+0] [0+0+0 37 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x128] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/nested-table-alignment.txt b/Tests/LibWeb/Layout/expected/table/nested-table-alignment.txt
index 0a1040d1bae..3ccc262c354 100644
--- a/Tests/LibWeb/Layout/expected/table/nested-table-alignment.txt
+++ b/Tests/LibWeb/Layout/expected/table/nested-table-alignment.txt
@@ -10,7 +10,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [159.890625,13] table-box [0+1+0 43.109375 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [161.890625,15] table-row-group [0+0+0 39.109375 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [161.890625,15] table-row [0+0+0 39.109375 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [162.890625,104] table-cell [0+0+1 37.109375 1+0+0] [0+0+89 16 89+0+0] [BFC] children: inline
+ BlockContainer <td> at [162.890625,16] table-cell [0+0+1 37.109375 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [162.890625,104 37.109375x16] baseline: 13
"right"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/nested-table-box-width.txt b/Tests/LibWeb/Layout/expected/table/nested-table-box-width.txt
index dc0c98f0253..9370b602b6c 100644
--- a/Tests/LibWeb/Layout/expected/table/nested-table-box-width.txt
+++ b/Tests/LibWeb/Layout/expected/table/nested-table-box-width.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [13,13] table-box [0+5+0 105.828125 0+5+0] [0+5+0 112 0+5+0] [TFC] children: not-inline
Box <tbody> at [15,15] table-row-group [0+0+0 101.828125 0+0+0] [0+0+0 108 0+0+0] children: not-inline
Box <tr> at [15,15] table-row [0+0+0 101.828125 0+0+0] [0+0+0 53 0+0+0] children: not-inline
- BlockContainer <td> at [25,33.5] table-cell [0+5+5 11.5625 5+5+0] [0+5+13.5 16 13.5+5+0] [BFC] children: inline
+ BlockContainer <td> at [25,25] table-cell [0+5+5 11.5625 5+5+0] [0+5+5 33 5+5+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [25,33.5 11.5625x16] baseline: 13
"X"
TextNode <#text> (not painted)
@@ -24,7 +24,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
"B"
TextNode <#text> (not painted)
Box <tr> at [15,70] table-row [0+0+0 101.828125 0+0+0] [0+0+0 53 0+0+0] children: not-inline
- BlockContainer <td> at [25,88.5] table-cell [0+5+5 11.5625 5+5+0] [0+5+13.5 16 13.5+5+0] [BFC] children: inline
+ BlockContainer <td> at [25,80] table-cell [0+5+5 11.5625 5+5+0] [0+5+5 33 5+5+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [25,88.5 11.09375x16] baseline: 13
"Y"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/percentage-cell-with-other-columns-fills-container.txt b/Tests/LibWeb/Layout/expected/table/percentage-cell-with-other-columns-fills-container.txt
index a32de8c49bd..acd7d31fca1 100644
--- a/Tests/LibWeb/Layout/expected/table/percentage-cell-with-other-columns-fills-container.txt
+++ b/Tests/LibWeb/Layout/expected/table/percentage-cell-with-other-columns-fills-container.txt
@@ -4,7 +4,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 784 0+0+0] [0+0+0 16 0+0+0] [BFC] children: not-inline
Box <div> at [8,8] table-box [0+0+0 784 0+0+0] [0+0+0 16 0+0+0] [TFC] children: not-inline
Box <(anonymous)> at [8,8] table-row [0+0+0 784 0+0+0] [0+0+0 16 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [8,21] table-cell [0+0+0 10 0+0+0] [0+0+13 0 3+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 10 0+0+0] [0+0+0 16 0+0+0] [BFC] children: not-inline
BlockContainer <span.icon> at [8,21] floating [0+0+0 10 0+0+0] [0+0+0 0 0+0+0] [BFC] children: not-inline
BlockContainer <span.text> at [18,8] table-cell [0+0+0 774 0+0+0] [0+0+0 16 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [18,8 9.34375x16] baseline: 13
diff --git a/Tests/LibWeb/Layout/expected/table/relatively-positioned-cell.txt b/Tests/LibWeb/Layout/expected/table/relatively-positioned-cell.txt
index d3decc32ff5..2c0d6b3ef6d 100644
--- a/Tests/LibWeb/Layout/expected/table/relatively-positioned-cell.txt
+++ b/Tests/LibWeb/Layout/expected/table/relatively-positioned-cell.txt
@@ -8,7 +8,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 5, rect: [8,8 51.140625x16] baseline: 13
"ITEM_"
TextNode <#text> (not painted)
- BlockContainer <div#line> at [59.140625,1] positioned table-cell [0+0+0 732.859375 0+0+0] [0+0+13 0 2+1+0] [BFC] children: not-inline
+ BlockContainer <div#line> at [59.140625,-12] positioned table-cell [0+0+0 732.859375 0+0+0] [0+0+0 15 0+1+0] [BFC] children: not-inline
BlockContainer <(anonymous)> at [8,24] [0+0+0 784 0+0+0] [0+0+0 0 0+0+0] children: inline
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/remove-irrelevant-whitespace-boxes.txt b/Tests/LibWeb/Layout/expected/table/remove-irrelevant-whitespace-boxes.txt
index d9a0e2c0ce5..5a5f940133d 100644
--- a/Tests/LibWeb/Layout/expected/table/remove-irrelevant-whitespace-boxes.txt
+++ b/Tests/LibWeb/Layout/expected/table/remove-irrelevant-whitespace-boxes.txt
@@ -4,16 +4,16 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [0,0] [0+0+0 20 0+0+780] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <div.table> at [0,0] table-box [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [TFC] children: not-inline
Box <div.row> at [0,0] table-row [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,0] table-cell [0+0+0 20 0+0+0] [0+0+0 0 10+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,0] table-cell [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
TableWrapper <(anonymous)> at [0,10] [0+0+0 20 0+0+780] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <div.table> at [0,10] table-box [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [TFC] children: not-inline
Box <div.group> at [0,10] table-row-group [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] children: not-inline
Box <div.row> at [0,10] table-row [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,10] table-cell [0+0+0 20 0+0+0] [0+0+0 0 10+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,10] table-cell [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
TableWrapper <(anonymous)> at [0,20] [0+0+0 20 0+0+780] [0+0+0 10 0+0+0] [BFC] children: not-inline
Box <div.table> at [0,20] table-box [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [TFC] children: not-inline
Box <div.row> at [0,20] table-row [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,20] table-cell [0+0+0 20 0+0+0] [0+0+0 0 10+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,20] table-cell [0+0+0 20 0+0+0] [0+0+0 10 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x30] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/row-group-between-loose-rows.txt b/Tests/LibWeb/Layout/expected/table/row-group-between-loose-rows.txt
index 23472e4e995..030f99c1df5 100644
--- a/Tests/LibWeb/Layout/expected/table/row-group-between-loose-rows.txt
+++ b/Tests/LibWeb/Layout/expected/table/row-group-between-loose-rows.txt
@@ -4,17 +4,17 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [0,0] [0+0+0 50 0+0+750] [0+0+0 100 0+0+0] [BFC] children: not-inline
Box <div.table> at [0,0] table-box [0+0+0 50 0+0+0] [0+0+0 100 0+0+0] [TFC] children: not-inline
Box <div.row> at [0,0] table-row [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,0] table-cell [0+0+0 50 0+0+0] [0+0+0 0 20+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,0] table-cell [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <div.group> at [0,20] table-row-group [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
Box <div.row> at [0,20] table-row [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,20] table-cell [0+0+0 50 0+0+0] [0+0+0 0 20+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,20] table-cell [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <div.row> at [0,40] table-row [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,40] table-cell [0+0+0 50 0+0+0] [0+0+0 0 20+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,40] table-cell [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <div.group> at [0,60] table-row-group [0+0+0 50 0+0+0] [0+0+0 40 0+0+0] children: not-inline
Box <div.row> at [0,60] table-row [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,60] table-cell [0+0+0 50 0+0+0] [0+0+0 0 20+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,60] table-cell [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
Box <div.row> at [0,80] table-row [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] children: not-inline
- BlockContainer <div.cell> at [0,80] table-cell [0+0+0 50 0+0+0] [0+0+0 0 20+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [0,80] table-cell [0+0+0 50 0+0+0] [0+0+0 20 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x100] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt b/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
index f2649747e66..7e32cc2d30f 100644
--- a/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
+++ b/Tests/LibWeb/Layout/expected/table/row-outer-size-with-computed-size.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [8,8] table-box [0+0+0 49.21875 0+0+0] [0+0+0 24 0+0+0] [TFC] children: not-inline
Box <tbody> at [10,10] table-row-group [0+0+0 45.21875 0+0+0] [0+0+0 20 0+0+0] children: not-inline
Box <tr> at [10,10] table-row [0+0+0 45.21875 0+0+0] [0+0+0 9 0+0+0] children: not-inline
- BlockContainer <td> at [11,14.5] table-cell [0+0+1 0 1+0+0] [0+0+4.5 0 4.5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [11,11] table-cell [0+0+1 0 1+0+0] [0+0+1 7 1+0+0] [BFC] children: not-inline
BlockContainer <td> at [16,12] table-cell [0+1+1 37.21875 1+1+0] [0+1+1 16 1+1+0] [BFC] children: inline
InlineNode <a> at [16,12] [0+0+0 37.21875 0+0+0] [0+0+0 16 0+0+0]
frag 0 from TextNode start: 0, length: 4, rect: [16,12 37.21875x16] baseline: 13
@@ -13,7 +13,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TextNode <#text> (not painted)
TextNode <#text> (not painted)
Box <tr> at [10,21] table-row [0+0+0 45.21875 0+0+0] [0+0+0 9 0+0+0] children: not-inline
- BlockContainer <td> at [11,25.5] table-cell [0+0+1 0 1+0+0] [0+0+4.5 0 4.5+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [11,22] table-cell [0+0+1 0 1+0+0] [0+0+1 7 1+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x40] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/row-px-height.txt b/Tests/LibWeb/Layout/expected/table/row-px-height.txt
index 7192f54b99e..81caa20418c 100644
--- a/Tests/LibWeb/Layout/expected/table/row-px-height.txt
+++ b/Tests/LibWeb/Layout/expected/table/row-px-height.txt
@@ -3,7 +3,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [8+0+0 102 0+0+690] [8+0+0 100 0+0+8] [BFC] children: not-inline
Box <body> at [8,8] table-box [0+0+0 102 0+0+0] [0+0+0 100 0+0+0] [TFC] children: not-inline
Box <div.row> at [8,8] table-row [0+0+0 102 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <div.cell> at [9,9] table-cell [0+1+0 100 0+1+0] [0+1+0 0 98+1+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [9,9] table-cell [0+1+0 100 0+1+0] [0+1+0 98 0+1+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x116] (z-index: auto)
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 d5ac6c59bfc..5a163babc67 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
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 73.828125 0+1+0] [0+1+0 110 0+1+0] [TFC] children: not-inline
Box <tbody> at [11,11] table-row-group [0+0+0 69.828125 0+0+0] [0+0+0 106 0+0+0] children: not-inline
Box <tr> at [11,11] table-row [0+0+0 69.828125 0+0+0] [0+0+0 52 0+0+0] children: not-inline
- BlockContainer <td> at [17,29] table-cell [0+1+5 11.5625 5+1+0] [0+1+17 16 17+1+0] [BFC] children: inline
+ BlockContainer <td> at [17,17] table-cell [0+1+5 11.5625 5+1+0] [0+1+5 40 5+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [17,29 11.5625x16] baseline: 13
"X"
TextNode <#text> (not painted)
@@ -29,7 +29,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
"C"
TextNode <#text> (not painted)
Box <tr> at [11,65] table-row [0+0+0 69.828125 0+0+0] [0+0+0 52 0+0+0] children: not-inline
- BlockContainer <td> at [17,83] table-cell [0+1+5 11.5625 5+1+0] [0+1+17 16 17+1+0] [BFC] children: inline
+ BlockContainer <td> at [17,71] table-cell [0+1+5 11.5625 5+1+0] [0+1+5 40 5+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [17,83 11.09375x16] baseline: 13
"Y"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-1.txt b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-1.txt
index c8e82120829..a74224f5117 100644
--- a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-1.txt
+++ b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-1.txt
@@ -4,9 +4,9 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 200 0+0+584] [0+0+0 150 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [TFC] children: not-inline
Box <div.row.a> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 50 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 0 50+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 50 0+0+0] [BFC] children: not-inline
Box <div.row.b> at [8,58] table-row [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,58] table-cell [0+0+0 200 0+0+0] [0+0+0 0 100+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [8,58] table-cell [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x166] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-2.txt b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-2.txt
index 0d4383a5cd2..5aa186a713e 100644
--- a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-2.txt
+++ b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-2.txt
@@ -4,9 +4,9 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 200 0+0+584] [0+0+0 300 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 300 0+0+0] [TFC] children: not-inline
Box <div.row.a> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 0 150+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [BFC] children: not-inline
Box <div.row.b> at [8,158] table-row [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,158] table-cell [0+0+0 200 0+0+0] [0+0+0 0 150+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [8,158] table-cell [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x316] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-3.txt b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-3.txt
index e0cf9514dd6..ef2edbf57bc 100644
--- a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-3.txt
+++ b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-3.txt
@@ -4,12 +4,12 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 200 0+0+584] [0+0+0 300 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 300 0+0+0] [TFC] children: not-inline
Box <div.row.a> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 16 134+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [8,8 9.34375x16] baseline: 13
"a"
TextNode <#text> (not painted)
Box <div.row.b> at [8,158] table-row [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,158] table-cell [0+0+0 200 0+0+0] [0+0+0 16 134+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,158] table-cell [0+0+0 200 0+0+0] [0+0+0 150 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [8,158 9.46875x16] baseline: 13
"b"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-4.txt b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-4.txt
index c87be882289..72e03a2fa11 100644
--- a/Tests/LibWeb/Layout/expected/table/rows-height-distribution-4.txt
+++ b/Tests/LibWeb/Layout/expected/table/rows-height-distribution-4.txt
@@ -4,12 +4,12 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
TableWrapper <(anonymous)> at [8,8] [0+0+0 200 0+0+584] [0+0+0 300 0+0+0] [BFC] children: not-inline
Box <div.table> at [8,8] table-box [0+0+0 200 0+0+0] [0+0+0 300 0+0+0] [TFC] children: not-inline
Box <div.row.a> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 16 84+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,8] table-cell [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [8,8 9.34375x16] baseline: 13
"a"
TextNode <#text> (not painted)
Box <div.row.b> at [8,108] table-row [0+0+0 200 0+0+0] [0+0+0 200 0+0+0] children: not-inline
- BlockContainer <div.cell> at [8,108] table-cell [0+0+0 200 0+0+0] [0+0+0 16 184+0+0] [BFC] children: inline
+ BlockContainer <div.cell> at [8,108] table-cell [0+0+0 200 0+0+0] [0+0+0 200 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [8,108 9.46875x16] baseline: 13
"b"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/rowspan-with-trailing-characters.txt b/Tests/LibWeb/Layout/expected/table/rowspan-with-trailing-characters.txt
index fcb81aaab92..e8ebc97ac1a 100644
--- a/Tests/LibWeb/Layout/expected/table/rowspan-with-trailing-characters.txt
+++ b/Tests/LibWeb/Layout/expected/table/rowspan-with-trailing-characters.txt
@@ -26,7 +26,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 6, rect: [99.140625,31 44.3125x16] baseline: 13
"Cell 2"
TextNode <#text> (not painted)
- BlockContainer <td> at [161.5625,41] table-cell [0+1+1 72.796875 1+1+0] [0+1+11 16 11+1+0] [BFC] children: inline
+ BlockContainer <td> at [161.5625,31] table-cell [0+1+1 72.796875 1+1+0] [0+1+1 36 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [175.65625,41 44.59375x16] baseline: 13
"Cell 3"
TextNode <#text> (not painted)
@@ -61,7 +61,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 7, rect: [95.578125,91 51.4375x16] baseline: 13
"Cell 10"
TextNode <#text> (not painted)
- BlockContainer <td> at [161.5625,101] table-cell [0+1+1 72.796875 1+1+0] [0+1+11 16 11+1+0] [BFC] children: inline
+ BlockContainer <td> at [161.5625,91] table-cell [0+1+1 72.796875 1+1+0] [0+1+1 36 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 7, rect: [173.859375,101 48.1875x16] baseline: 13
"Cell 11"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/rowspan.txt b/Tests/LibWeb/Layout/expected/table/rowspan.txt
index 9aad11c4ca8..fe8bdfcab59 100644
--- a/Tests/LibWeb/Layout/expected/table/rowspan.txt
+++ b/Tests/LibWeb/Layout/expected/table/rowspan.txt
@@ -18,7 +18,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
"Header 3"
TextNode <#text> (not painted)
Box <tr> at [10,30] table-row [0+0+0 225.359375 0+0+0] [0+0+0 18 0+0+0] children: not-inline
- BlockContainer <td> at [11,41] table-cell [0+0+1 70.046875 1+0+0] [0+0+11 16 11+0+0] [BFC] children: inline
+ BlockContainer <td> at [11,31] table-cell [0+0+1 70.046875 1+0+0] [0+0+1 36 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [11,41 49.609375x16] baseline: 13
"Row 1"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/style-invalidation-propagation-to-table-wrapper.txt b/Tests/LibWeb/Layout/expected/table/style-invalidation-propagation-to-table-wrapper.txt
index 3d0eb30bbc9..75416f80a7a 100644
--- a/Tests/LibWeb/Layout/expected/table/style-invalidation-propagation-to-table-wrapper.txt
+++ b/Tests/LibWeb/Layout/expected/table/style-invalidation-propagation-to-table-wrapper.txt
@@ -6,7 +6,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [204,8] table-box [0+0+0 392 0+0+0] [0+0+0 106 0+0+0] [TFC] children: not-inline
Box <tbody> at [206,10] table-row-group [0+0+0 388 0+0+0] [0+0+0 102 0+0+0] children: not-inline
Box <tr> at [206,10] table-row [0+0+0 388 0+0+0] [0+0+0 102 0+0+0] children: not-inline
- BlockContainer <td> at [207,61] table-cell [0+0+1 386 1+0+0] [0+0+51 0 51+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [207,11] table-cell [0+0+1 386 1+0+0] [0+0+1 100 1+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x122] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/table-align-center-with-margin.txt b/Tests/LibWeb/Layout/expected/table/table-align-center-with-margin.txt
index ead41ce14bc..6d34477371d 100644
--- a/Tests/LibWeb/Layout/expected/table/table-align-center-with-margin.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-align-center-with-margin.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [109,101] table-box [0+1+0 87.34375 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [111,103] table-row-group [0+0+0 83.34375 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [111,103] table-row [0+0+0 83.34375 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [112,192] table-cell [0+0+1 81.34375 1+0+0] [0+0+89 16 89+0+0] [BFC] children: inline
+ BlockContainer <td> at [112,104] table-cell [0+0+1 81.34375 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 10, rect: [112,192 81.34375x16] baseline: 13
"off-center"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/table-align-center.txt b/Tests/LibWeb/Layout/expected/table/table-align-center.txt
index ee2844e9d1d..ec4251806c2 100644
--- a/Tests/LibWeb/Layout/expected/table/table-align-center.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-align-center.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [371.1875,9] table-box [0+1+0 57.625 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [373.1875,11] table-row-group [0+0+0 53.625 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [373.1875,11] table-row [0+0+0 53.625 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [374.1875,100] table-cell [0+0+1 51.625 1+0+0] [0+0+89 16 89+0+0] [BFC] children: inline
+ BlockContainer <td> at [374.1875,12] table-cell [0+0+1 51.625 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [374.1875,100 51.625x16] baseline: 13
"center"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/table-cell-with-flex-display.txt b/Tests/LibWeb/Layout/expected/table/table-cell-with-flex-display.txt
index 83bd5f34c04..58425fa788f 100644
--- a/Tests/LibWeb/Layout/expected/table/table-cell-with-flex-display.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-cell-with-flex-display.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [8,8] table-box [0+0+0 137.15625 0+0+0] [0+0+0 106 0+0+0] [TFC] children: not-inline
Box <tbody> at [10,10] table-row-group [0+0+0 133.15625 0+0+0] [0+0+0 102 0+0+0] children: not-inline
Box <tr> at [10,10] table-row [0+0+0 133.15625 0+0+0] [0+0+0 102 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [10,10] table-cell [0+0+0 29.15625 0+0+0] [0+0+0 18 84+0+0] [BFC] children: not-inline
+ BlockContainer <(anonymous)> at [10,10] table-cell [0+0+0 29.15625 0+0+0] [0+0+0 102 0+0+0] [BFC] children: not-inline
Box <td.flex> at [11,11] flex-container(row) [0+0+1 27.15625 1+0+0] [0+0+1 16 1+0+0] [FFC] children: not-inline
BlockContainer <(anonymous)> at [11,11] flex-item [0+0+0 27.15625 0+0+0] [0+0+0 16 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [11,11 27.15625x16] baseline: 13
diff --git a/Tests/LibWeb/Layout/expected/table/table-cellpadding.txt b/Tests/LibWeb/Layout/expected/table/table-cellpadding.txt
index 9a9d5df190d..60fe30a59d0 100644
--- a/Tests/LibWeb/Layout/expected/table/table-cellpadding.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-cellpadding.txt
@@ -5,15 +5,15 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 496.1875 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [11,11] table-row-group [0+0+0 492.1875 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [11,11] table-row [0+0+0 492.1875 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [71,71] table-cell [0+0+60 26.640625 60+0+0] [0+0+60 16 118+0+0] [BFC] children: inline
+ BlockContainer <td> at [71,71] table-cell [0+0+60 26.640625 60+0+0] [0+0+60 74 60+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [71,71 26.640625x16] baseline: 13
"top"
TextNode <#text> (not painted)
- BlockContainer <td> at [219.640625,100] table-cell [0+0+60 45.4375 60+0+0] [0+0+89 16 89+0+0] [BFC] children: inline
+ BlockContainer <td> at [219.640625,71] table-cell [0+0+60 45.4375 60+0+0] [0+0+60 74 60+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [219.640625,100 45.4375x16] baseline: 13
"middle"
TextNode <#text> (not painted)
- BlockContainer <td> at [387.078125,129] table-cell [0+0+60 56.109375 60+0+0] [0+0+118 16 60+0+0] [BFC] children: inline
+ BlockContainer <td> at [387.078125,71] table-cell [0+0+60 56.109375 60+0+0] [0+0+60 74 60+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [387.078125,129 56.109375x16] baseline: 13
"bottom"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/table-formation-with-rowspan-in-the-middle.txt b/Tests/LibWeb/Layout/expected/table/table-formation-with-rowspan-in-the-middle.txt
index e3dbd9c3f35..7646758be0a 100644
--- a/Tests/LibWeb/Layout/expected/table/table-formation-with-rowspan-in-the-middle.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-formation-with-rowspan-in-the-middle.txt
@@ -9,11 +9,11 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [19,19 9.59375x16] baseline: 13
"0"
TextNode <#text> (not painted)
- BlockContainer <td> at [49.59375,37.5] table-cell [0+1+10 14.265625 10+1+0] [0+1+28.5 16 28.5+1+0] [BFC] children: inline
+ BlockContainer <td> at [49.59375,19] table-cell [0+1+10 14.265625 10+1+0] [0+1+10 53 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [49.59375,37.5 14.265625x16] baseline: 13
"A"
TextNode <#text> (not painted)
- BlockContainer <td> at [84.859375,56] table-cell [0+1+10 11.5625 10+1+0] [0+1+47 16 47+1+0] [BFC] children: inline
+ BlockContainer <td> at [84.859375,19] table-cell [0+1+10 11.5625 10+1+0] [0+1+10 90 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [84.859375,56 11.5625x16] baseline: 13
"X"
TextNode <#text> (not painted)
@@ -27,7 +27,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 1, rect: [19,93 8.8125x16] baseline: 13
"2"
TextNode <#text> (not painted)
- BlockContainer <td> at [49.59375,111.5] table-cell [0+1+10 14.265625 10+1+0] [0+1+28.5 16 28.5+1+0] [BFC] children: inline
+ BlockContainer <td> at [49.59375,93] table-cell [0+1+10 14.265625 10+1+0] [0+1+10 53 10+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 1, rect: [49.59375,111.5 9.34375x16] baseline: 13
"B"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/table-header-and-footer-groups.txt b/Tests/LibWeb/Layout/expected/table/table-header-and-footer-groups.txt
index 58904c1b857..3aed69238fc 100644
--- a/Tests/LibWeb/Layout/expected/table/table-header-and-footer-groups.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-header-and-footer-groups.txt
@@ -4,13 +4,13 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <body.table> at [10,10] table-box [0+1+0 300 0+1+0] [0+1+0 200 0+1+0] [TFC] children: not-inline
Box <div.bottom> at [10,110] table-footer-group [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] children: not-inline
Box <(anonymous)> at [10,110] table-row [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [10,110] table-cell [0+0+0 300 0+0+0] [0+0+0 16 84+0+0] [BFC] children: inline
+ BlockContainer <(anonymous)> at [10,110] table-cell [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [10,110 56.109375x16] baseline: 13
"bottom"
TextNode <#text> (not painted)
Box <div.top> at [10,10] table-header-group [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] children: not-inline
Box <(anonymous)> at [10,10] table-row [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <(anonymous)> at [10,10] table-cell [0+0+0 300 0+0+0] [0+0+0 16 84+0+0] [BFC] children: inline
+ BlockContainer <(anonymous)> at [10,10] table-cell [0+0+0 300 0+0+0] [0+0+0 100 0+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [10,10 26.640625x16] baseline: 13
"top"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/table-max-content-width.txt b/Tests/LibWeb/Layout/expected/table/table-max-content-width.txt
index 41377516645..2cc4aaf3584 100644
--- a/Tests/LibWeb/Layout/expected/table/table-max-content-width.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-max-content-width.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table.table> at [18,18] table-box [0+10+0 106 0+10+0] [0+10+0 104 0+10+0] [TFC] children: not-inline
Box <tbody> at [20,20] table-row-group [0+0+0 102 0+0+0] [0+0+0 100 0+0+0] children: not-inline
Box <tr> at [20,20] table-row [0+0+0 102 0+0+0] [0+0+0 100 0+0+0] children: not-inline
- BlockContainer <td> at [21,70] table-cell [0+0+1 100 1+0+0] [0+0+50 0 50+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [21,21] table-cell [0+0+1 100 1+0+0] [0+0+1 98 1+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x140] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/table-width.txt b/Tests/LibWeb/Layout/expected/table/table-width.txt
index bac7356f78d..33a274a23b7 100644
--- a/Tests/LibWeb/Layout/expected/table/table-width.txt
+++ b/Tests/LibWeb/Layout/expected/table/table-width.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table.table> at [108,108] table-box [0+100+0 584 0+100+0] [0+100+0 16 0+100+0] [TFC] children: not-inline
Box <tbody> at [110,110] table-row-group [0+0+0 580 0+0+0] [0+0+0 12 0+0+0] children: not-inline
Box <tr> at [110,110] table-row [0+0+0 580 0+0+0] [0+0+0 12 0+0+0] children: not-inline
- BlockContainer <td.cell> at [111,116] table-cell [0+0+1 578 1+0+0] [0+0+6 0 6+0+0] [BFC] children: not-inline
+ BlockContainer <td.cell> at [111,111] table-cell [0+0+1 578 1+0+0] [0+0+1 10 1+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x232] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/td-valign.txt b/Tests/LibWeb/Layout/expected/table/td-valign.txt
index 1dc012107ee..ad16b946077 100644
--- a/Tests/LibWeb/Layout/expected/table/td-valign.txt
+++ b/Tests/LibWeb/Layout/expected/table/td-valign.txt
@@ -5,15 +5,15 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [9,9] table-box [0+1+0 142.1875 0+1+0] [0+1+0 198 0+1+0] [TFC] children: not-inline
Box <tbody> at [11,11] table-row-group [0+0+0 138.1875 0+0+0] [0+0+0 194 0+0+0] children: not-inline
Box <tr> at [11,11] table-row [0+0+0 138.1875 0+0+0] [0+0+0 194 0+0+0] children: not-inline
- BlockContainer <td> at [12,12] table-cell [0+0+1 26.640625 1+0+0] [0+0+1 16 177+0+0] [BFC] children: inline
+ BlockContainer <td> at [12,12] table-cell [0+0+1 26.640625 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 3, rect: [12,12 26.640625x16] baseline: 13
"top"
TextNode <#text> (not painted)
- BlockContainer <td> at [42.640625,100] table-cell [0+0+1 45.4375 1+0+0] [0+0+89 16 89+0+0] [BFC] children: inline
+ BlockContainer <td> at [42.640625,12] table-cell [0+0+1 45.4375 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [42.640625,100 45.4375x16] baseline: 13
"middle"
TextNode <#text> (not painted)
- BlockContainer <td> at [92.078125,188] table-cell [0+0+1 56.109375 1+0+0] [0+0+177 16 1+0+0] [BFC] children: inline
+ BlockContainer <td> at [92.078125,12] table-cell [0+0+1 56.109375 1+0+0] [0+0+1 192 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 6, rect: [92.078125,188 56.109375x16] baseline: 13
"bottom"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/tr-valign.txt b/Tests/LibWeb/Layout/expected/table/tr-valign.txt
index cd6788c878b..8fd8179fa56 100644
--- a/Tests/LibWeb/Layout/expected/table/tr-valign.txt
+++ b/Tests/LibWeb/Layout/expected/table/tr-valign.txt
@@ -7,7 +7,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <tr> at [11,11] table-row [0+0+0 210 0+0+0] [0+0+0 504 0+0+0] children: not-inline
BlockContainer <td> at [12,12] table-cell [0+0+1 102 1+0+0] [0+0+1 502 1+0+0] [BFC] children: not-inline
BlockContainer <div> at [13,13] [0+1+0 100 0+1+0] [0+1+0 500 0+1+0] children: not-inline
- BlockContainer <td> at [118,12] table-cell [0+0+1 102 1+0+0] [0+0+1 102 401+0+0] [BFC] children: not-inline
+ BlockContainer <td> at [118,12] table-cell [0+0+1 102 1+0+0] [0+0+1 502 1+0+0] [BFC] children: not-inline
BlockContainer <div> at [119,13] [0+1+0 100 0+1+0] [0+1+0 100 0+1+0] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
diff --git a/Tests/LibWeb/Layout/expected/table/vertical-align-baseline.txt b/Tests/LibWeb/Layout/expected/table/vertical-align-baseline.txt
index d3a4112989b..d32c0821bd6 100644
--- a/Tests/LibWeb/Layout/expected/table/vertical-align-baseline.txt
+++ b/Tests/LibWeb/Layout/expected/table/vertical-align-baseline.txt
@@ -9,7 +9,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
frag 0 from TextNode start: 0, length: 13, rect: [10,10 273.984375x40] baseline: 32
"Text baseline"
TextNode <#text> (not painted)
- BlockContainer <td.small-text> at [362.90625,34] table-cell [0+1+1 255.75 1+1+0] [0+1+25 10 7+1+0] [BFC] children: inline
+ BlockContainer <td.small-text> at [362.90625,10] table-cell [0+1+1 255.75 1+1+0] [0+1+1 40 1+1+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 12, rect: [362.90625,34 62.28125x10] baseline: 8
"Smaller text"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/vertical-align-middle-td-vs-div.txt b/Tests/LibWeb/Layout/expected/table/vertical-align-middle-td-vs-div.txt
index fa1f34c84e9..ff6ea2e2bad 100644
--- a/Tests/LibWeb/Layout/expected/table/vertical-align-middle-td-vs-div.txt
+++ b/Tests/LibWeb/Layout/expected/table/vertical-align-middle-td-vs-div.txt
@@ -5,7 +5,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <table> at [8,8] table-box [0+0+0 42.84375 0+0+0] [0+0+0 106 0+0+0] [TFC] children: not-inline
Box <tbody> at [10,10] table-row-group [0+0+0 38.84375 0+0+0] [0+0+0 102 0+0+0] children: not-inline
Box <tr> at [10,10] table-row [0+0+0 38.84375 0+0+0] [0+0+0 102 0+0+0] children: not-inline
- BlockContainer <td> at [11,53] table-cell [0+0+1 36.84375 1+0+0] [0+0+43 16 43+0+0] [BFC] children: inline
+ BlockContainer <td> at [11,11] table-cell [0+0+1 36.84375 1+0+0] [0+0+1 100 1+0+0] [BFC] children: inline
frag 0 from TextNode start: 0, length: 5, rect: [11,53 36.84375x16] baseline: 13
"hello"
TextNode <#text> (not painted)
diff --git a/Tests/LibWeb/Layout/expected/table/wrap-float-in-anonymous-table-cell.txt b/Tests/LibWeb/Layout/expected/table/wrap-float-in-anonymous-table-cell.txt
index 04377c6611d..660dce99c13 100644
--- a/Tests/LibWeb/Layout/expected/table/wrap-float-in-anonymous-table-cell.txt
+++ b/Tests/LibWeb/Layout/expected/table/wrap-float-in-anonymous-table-cell.txt
@@ -6,7 +6,7 @@ Viewport <#document> at [0,0] [0+0+0 800 0+0+0] [0+0+0 600 0+0+0] [BFC] children
Box <(anonymous)> at [8,8] table-row [0+0+0 200 0+0+0] [0+0+0 100 0+0+0] children: not-inline
BlockContainer <(anonymous)> at [8,8] table-cell [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
BlockContainer <div.floaty> at [8,8] floating [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
- BlockContainer <div.cell> at [108,108] table-cell [0+0+0 100 0+0+0] [0+0+100 0 0+0+0] [BFC] children: not-inline
+ BlockContainer <div.cell> at [108,8] table-cell [0+0+0 100 0+0+0] [0+0+0 100 0+0+0] [BFC] children: not-inline
SC for Viewport<#document> [0,0 800x600] (z-index: auto)
SC for BlockContainer<HTML> [0,0 800x316] (z-index: auto)
diff --git a/Tests/LibWeb/Text/expected/table-cell-measurement-cache-width-changes.txt b/Tests/LibWeb/Text/expected/table-cell-measurement-cache-width-changes.txt
index 7e9fbf14aff..c9dd952874d 100644
--- a/Tests/LibWeb/Text/expected/table-cell-measurement-cache-width-changes.txt
+++ b/Tests/LibWeb/Text/expected/table-cell-measurement-cache-width-changes.txt
@@ -1,5 +1,5 @@
-900px: 60 laid out ahead, 60 replayed, 0 laid out again, height 240
-950px: 60 laid out ahead, 60 replayed, 0 laid out again, height 240
-400px: 60 laid out ahead, 60 replayed, 0 laid out again, height 480
-350px: 40 laid out ahead, 40 replayed, 0 laid out again, height 480
-1000px: 60 laid out ahead, 60 replayed, 0 laid out again, height 240
+900px: 60 laid out, 0 replayed, height 240
+950px: 60 laid out, 0 replayed, height 240
+400px: 60 laid out, 0 replayed, height 480
+350px: 40 laid out, 0 replayed, height 480
+1000px: 60 laid out, 0 replayed, height 240
diff --git a/Tests/LibWeb/Text/expected/table/cell-vertical-align-resolved-style.txt b/Tests/LibWeb/Text/expected/table/cell-vertical-align-resolved-style.txt
new file mode 100644
index 00000000000..0f3fa866681
--- /dev/null
+++ b/Tests/LibWeb/Text/expected/table/cell-vertical-align-resolved-style.txt
@@ -0,0 +1,7 @@
+top: padding 5px 5px, height 190px, client height 200, content top 5
+middle: padding 5px 5px, height 190px, client height 200, content top 90
+bottom: padding 5px 5px, height 190px, client height 200, content top 175
+baseline: padding 5px 5px, height 190px, client height 200, content top 5
+align-content-center: padding 5px 5px, height 190px, client height 200, content top 90
+align-content-end: padding 5px 5px, height 190px, client height 200, content top 175
+align-content-start-over-bottom: padding 5px 5px, height 190px, client height 200, content top 5
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/css-align/blocks/align-content-table-cell.txt b/Tests/LibWeb/Text/expected/wpt-import/css/css-align/blocks/align-content-table-cell.txt
index b3a608b8c22..ab409c762d7 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/css-align/blocks/align-content-table-cell.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/css-align/blocks/align-content-table-cell.txt
@@ -2,13 +2,12 @@ Harness status: OK
Found 8 tests
-4 Pass
-4 Fail
-Fail vertical-align:top and align-content:start are equivalent
+8 Pass
+Pass vertical-align:top and align-content:start are equivalent
Pass vertical-align:middle and `align-content:unsafe center` are equivalent
-Fail vertical-align:bottom and `align-content:unsafe end` are equivalent
-Fail vertical-align:baseline and align-content:baseline are equivalent
+Pass vertical-align:bottom and `align-content:unsafe end` are equivalent
+Pass vertical-align:baseline and align-content:baseline are equivalent
Pass vertical-align:middle and `align-content:safe center` are equivalent if the container is tall
-Fail vertical-align:bottom and `align-content:safe end` are equivalent if the container is tall
+Pass vertical-align:bottom and `align-content:safe end` are equivalent if the container is tall
Pass `align-content:safe center` is equivalent to `unsafe center` even if the specified `height` is short
Pass `align-content:safe end` is equivalent to `unsafe end` even if the specified `height` is short
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/input/layout-run-cache-nested-reuse-under-measurement.html b/Tests/LibWeb/Text/input/layout-run-cache-nested-reuse-under-measurement.html
index 887ff50a0b1..cb5ec9596f7 100644
--- a/Tests/LibWeb/Text/input/layout-run-cache-nested-reuse-under-measurement.html
+++ b/Tests/LibWeb/Text/input/layout-run-cache-nested-reuse-under-measurement.html
@@ -29,9 +29,8 @@
BlockContainer<TD>#cell/block RUN (cache=miss)
BlockContainer<DIV>#nested/block RUN (cache=miss)
BlockContainer<TD>#cell MEASURE max-content block (cache=hit)
- BlockContainer<TD>#cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
+ BlockContainer<TD>#cell/block RUN (cache=miss)
BlockContainer<DIV>#nested/block REPLAY FRAGMENTS
- BlockContainer<TD>#cell/block REPLAY FRAGMENTS
`,
check: equal => {
equal(nested.getBoundingClientRect().width, 80, "nested width");
@@ -54,9 +53,8 @@
BlockContainer<TD>#cell/block RUN (cache=miss)
BlockContainer<DIV>#nested/block REUSE SUBTREE
BlockContainer<TD>#cell MEASURE max-content block (cache=hit)
- BlockContainer<TD>#cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
+ BlockContainer<TD>#cell/block RUN (cache=miss)
BlockContainer<DIV>#nested/block REUSE SUBTREE
- BlockContainer<TD>#cell/block REPLAY FRAGMENTS
`,
check: equal => {
const rect = nested.getBoundingClientRect();
diff --git a/Tests/LibWeb/Text/input/layout-run-cache-table-cell-ahead-of-intrinsic-padding.html b/Tests/LibWeb/Text/input/layout-run-cache-table-cell-ahead-of-intrinsic-padding.html
index 8a36e1e64fe..75a910ad1ae 100644
--- a/Tests/LibWeb/Text/input/layout-run-cache-table-cell-ahead-of-intrinsic-padding.html
+++ b/Tests/LibWeb/Text/input/layout-run-cache-table-cell-ahead-of-intrinsic-padding.html
@@ -66,10 +66,8 @@
BlockContainer<TD>#markup-cell MEASURE min-content inline (cache=hit)
BlockContainer<TD>#markup-cell MEASURE max-content block (cache=hit)
BlockContainer<TD>#markup-cell MEASURE max-content block (cache=hit)
- BlockContainer<TD>#text-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#markup-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#text-cell/block REPLAY FRAGMENTS
- BlockContainer<TD>#markup-cell/block REPLAY FRAGMENTS
+ BlockContainer<TD>#text-cell/block RUN (cache=miss)
+ BlockContainer<TD>#markup-cell/block RUN (cache=miss)
`,
check: equal => {
const text = document.getElementById("text-cell").getBoundingClientRect();
@@ -98,10 +96,8 @@
BlockContainer<TD>#markup-cell/block RUN (cache=miss)
BlockContainer<TD>#markup-cell MEASURE max-content block (cache=miss)
BlockContainer<TD>#markup-cell/block RUN (cache=miss)
- BlockContainer<TD>#text-cell/block READ RESULT AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#markup-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#text-cell/block REUSE SUBTREE
- BlockContainer<TD>#markup-cell/block REPLAY FRAGMENTS
+ BlockContainer<TD>#text-cell/block REPLAY FRAGMENTS
+ BlockContainer<TD>#markup-cell/block RUN (cache=miss)
`,
check: equal => {
const top = checkPlacement(equal, 0.5);
@@ -132,10 +128,8 @@
BlockContainer<TD>#markup-cell/block RUN (cache=miss)
BlockContainer<TD>#markup-cell MEASURE max-content block (cache=miss)
BlockContainer<TD>#markup-cell/block RUN (cache=miss)
- BlockContainer<TD>#text-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#markup-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#text-cell/block REPLAY FRAGMENTS
- BlockContainer<TD>#markup-cell/block REPLAY FRAGMENTS
+ BlockContainer<TD>#text-cell/block RUN (cache=miss)
+ BlockContainer<TD>#markup-cell/block RUN (cache=miss)
`,
check: equal => { checkPlacement(equal, 1); },
},
diff --git a/Tests/LibWeb/Text/input/layout-run-cache-table-percentage-cell-height-misses.html b/Tests/LibWeb/Text/input/layout-run-cache-table-percentage-cell-height-misses.html
index 217ae8a97aa..584d5a6105f 100644
--- a/Tests/LibWeb/Text/input/layout-run-cache-table-percentage-cell-height-misses.html
+++ b/Tests/LibWeb/Text/input/layout-run-cache-table-percentage-cell-height-misses.html
@@ -37,8 +37,7 @@
BlockContainer<TD>#percentage-cell MEASURE max-content block (cache=miss)
BlockContainer<TD>#percentage-cell/block RUN (cache=miss)
BlockContainer<TD>#percentage-cell MEASURE max-content block (cache=hit)
- BlockContainer<TD>#percentage-cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#percentage-cell/block READ RESULT AHEAD OF INTRINSIC BLOCK PADDING
+ BlockContainer<TD>#percentage-cell/block RUN (cache=miss)
BlockContainer<TD>#percentage-cell/block REPLAY FRAGMENTS
BlockContainer<TD>#fixed-cell MEASURE min-content inline (cache=hit)
TableWrapper(anonymous)/block REUSE SUBTREE
diff --git a/Tests/LibWeb/Text/input/table-cell-measurement-cache-misses.html b/Tests/LibWeb/Text/input/table-cell-measurement-cache-misses.html
index 31be3427944..0b52493986b 100644
--- a/Tests/LibWeb/Text/input/table-cell-measurement-cache-misses.html
+++ b/Tests/LibWeb/Text/input/table-cell-measurement-cache-misses.html
@@ -15,7 +15,10 @@
const parts = [];
for (let i = 0; i < ROWS; ++i)
parts.push(`<tr><td class="num" id="r${i}c0">${i}</td><td class="num" id="r${i}c1">${i}</td><td id="r${i}c2">line ${i} with <span>some</span> <b>markup</b></td></tr>`);
- const missedCells = work => work.events.filter(event => event.event === "run" && event.action === "RUN AHEAD OF INTRINSIC BLOCK PADDING");
+ const missedCells = work => {
+ const tableRun = work.events.find(event => event.event === "run" && event.box === "Box<TABLE>#table");
+ return work.events.filter(event => tableRun && event.depth === tableRun.depth + 1 && event.event === "run" && event.action === "RUN");
+ };
const lines = [];
let work = layoutWork(() => document.getElementById("rows").innerHTML = parts.join(""));
diff --git a/Tests/LibWeb/Text/input/table-cell-measurement-cache-width-changes.html b/Tests/LibWeb/Text/input/table-cell-measurement-cache-width-changes.html
index 475778b4d7d..ebb7aa35093 100644
--- a/Tests/LibWeb/Text/input/table-cell-measurement-cache-width-changes.html
+++ b/Tests/LibWeb/Text/input/table-cell-measurement-cache-width-changes.html
@@ -16,11 +16,11 @@
document.getElementById("rows").innerHTML = parts.join("");
const table = document.getElementById("table");
- // Each cell is laid out once ahead of its intrinsic padding, and its committing run replays that layout.
+ // Each cell is laid out once, by the run that commits it, however its contents are aligned in its row.
const measure = width => {
const work = layoutWork(() => table.style.width = `${width}px`);
const cellRuns = action => work.count(event => event.event === "run" && event.box.startsWith("BlockContainer<TD>") && event.action === action);
- println(`${width}px: ${cellRuns("RUN AHEAD OF INTRINSIC BLOCK PADDING")} laid out ahead, ${cellRuns("REPLAY FRAGMENTS")} replayed, ${cellRuns("RUN")} laid out again, height ${table.offsetHeight}`);
+ println(`${width}px: ${cellRuns("RUN")} laid out, ${cellRuns("REPLAY FRAGMENTS")} replayed, height ${table.offsetHeight}`);
};
layoutWork(() => table.style.width = "1000px");
diff --git a/Tests/LibWeb/Text/input/table-measurement-reuse-work.html b/Tests/LibWeb/Text/input/table-measurement-reuse-work.html
index aad44aab128..f3b5f26d585 100644
--- a/Tests/LibWeb/Text/input/table-measurement-reuse-work.html
+++ b/Tests/LibWeb/Text/input/table-measurement-reuse-work.html
@@ -37,11 +37,9 @@
TableWrapper(anonymous) MEASURE max-content block (cache=miss)
TableWrapper(anonymous)/block RUN (cache=miss)
Box<TABLE>#table/table RUN (cache=miss)
- BlockContainer<TD>#cell/block RUN AHEAD OF INTRINSIC BLOCK PADDING
+ BlockContainer<TD>#cell/block RUN (cache=miss)
BlockContainer<DIV> REUSE IN-FLOW SUBTREE
BlockContainer<SPAN>.control/block RUN (cache=miss)
- BlockContainer<TD>/block READ RESULT AHEAD OF INTRINSIC BLOCK PADDING
- BlockContainer<TD>#cell/block REPLAY FRAGMENTS
BlockContainer<TD>/block REUSE SUBTREE
TableWrapper(anonymous) MEASURE max-content block (cache=hit)
TableWrapper(anonymous) MEASURE max-content block (cache=hit)
diff --git a/Tests/LibWeb/Text/input/table/cell-vertical-align-resolved-style.html b/Tests/LibWeb/Text/input/table/cell-vertical-align-resolved-style.html
new file mode 100644
index 00000000000..1b4ad6358e1
--- /dev/null
+++ b/Tests/LibWeb/Text/input/table/cell-vertical-align-resolved-style.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<style>
+ body {
+ margin: 0;
+ }
+ table {
+ border-spacing: 0;
+ }
+ td {
+ padding: 5px;
+ }
+ td > div {
+ width: 20px;
+ height: 20px;
+ }
+</style>
+<table>
+ <tr style="height: 200px">
+ <td id="top" style="vertical-align: top"><div></div></td>
+ <td id="middle" style="vertical-align: middle"><div></div></td>
+ <td id="bottom" style="vertical-align: bottom"><div></div></td>
+ <td id="baseline" style="vertical-align: baseline"><div></div></td>
+ <td id="align-content-center" style="align-content: center"><div></div></td>
+ <td id="align-content-end" style="align-content: end"><div></div></td>
+ <td id="align-content-start-over-bottom" style="vertical-align: bottom; align-content: start"><div></div></td>
+ </tr>
+</table>
+<script src="../include.js"></script>
+<script>
+ test(() => {
+ for (const cell of document.querySelectorAll("td")) {
+ const style = getComputedStyle(cell);
+ const contentTop = cell.firstElementChild.getBoundingClientRect().top - cell.getBoundingClientRect().top;
+ println(`${cell.id}: padding ${style.paddingTop} ${style.paddingBottom}, height ${style.height}, client height ${cell.clientHeight}, content top ${contentTop}`);
+ }
+ });
+</script>