1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 07:17:35 +00:00

LibWeb: Propagate layout mode of table formatting context to table cells

This commit is contained in:
Aliaksandr Kalenik 2023-01-14 15:11:58 +01:00 committed by Andreas Kling
parent 80578ead45
commit b44d977bf8
2 changed files with 8 additions and 8 deletions

View file

@ -366,7 +366,7 @@ void TableFormattingContext::determine_intrisic_size_of_table_container(Availabl
} }
} }
void TableFormattingContext::calculate_row_heights() void TableFormattingContext::calculate_row_heights(LayoutMode layout_mode)
{ {
for (auto& cell : m_cells) { for (auto& cell : m_cells) {
auto& cell_state = m_state.get_mutable(cell.box); auto& cell_state = m_state.get_mutable(cell.box);
@ -395,10 +395,10 @@ void TableFormattingContext::calculate_row_heights()
cell_state.border_right = (should_hide_borders && is_right_most_cell) ? 0 : cell.box.computed_values().border_right().width; cell_state.border_right = (should_hide_borders && is_right_most_cell) ? 0 : cell.box.computed_values().border_right().width;
cell_state.set_content_width((span_width - cell_state.border_box_left() - cell_state.border_box_right())); cell_state.set_content_width((span_width - cell_state.border_box_left() - cell_state.border_box_right()));
auto independent_formatting_context = layout_inside(cell.box, LayoutMode::Normal, cell_state.available_inner_space_or_constraints_from(*m_available_space)); if (auto independent_formatting_context = layout_inside(cell.box, layout_mode, cell_state.available_inner_space_or_constraints_from(*m_available_space))) {
VERIFY(independent_formatting_context);
cell_state.set_content_height(independent_formatting_context->automatic_content_height()); cell_state.set_content_height(independent_formatting_context->automatic_content_height());
independent_formatting_context->parent_context_did_dimension_child_root_box(); independent_formatting_context->parent_context_did_dimension_child_root_box();
}
cell.baseline = box_baseline(m_state, cell.box); cell.baseline = box_baseline(m_state, cell.box);
@ -484,7 +484,7 @@ void TableFormattingContext::position_cell_boxes()
} }
} }
void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace const& available_space) void TableFormattingContext::run(Box const& box, LayoutMode layout_mode, AvailableSpace const& available_space)
{ {
m_available_space = available_space; m_available_space = available_space;
@ -507,7 +507,7 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons
// Distribute the width of the table among columns. // Distribute the width of the table among columns.
distribute_width_to_columns(); distribute_width_to_columns();
calculate_row_heights(); calculate_row_heights(layout_mode);
position_row_boxes(); position_row_boxes();
position_cell_boxes(); position_cell_boxes();

View file

@ -32,7 +32,7 @@ private:
void compute_table_width(); void compute_table_width();
void distribute_width_to_columns(); void distribute_width_to_columns();
void determine_intrisic_size_of_table_container(AvailableSpace const& available_space); void determine_intrisic_size_of_table_container(AvailableSpace const& available_space);
void calculate_row_heights(); void calculate_row_heights(LayoutMode layout_mode);
void position_row_boxes(); void position_row_boxes();
void position_cell_boxes(); void position_cell_boxes();