summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Layout
diff options
context:
space:
mode:
authorAliaksandr Kalenik <kalenik.aliaksandr@gmail.com>2023-01-14 15:11:58 +0100
committerAndreas Kling <kling@serenityos.org>2023-01-14 19:22:08 +0100
commitb44d977bf868f454dd2384bdc2ec0507e15e466b (patch)
treeaeca088870ff66f6689e6b36c29e28377999d829 /Userland/Libraries/LibWeb/Layout
parent80578ead45ff6b36f49b96437da2f85485c010e0 (diff)
downloadserenity-b44d977bf868f454dd2384bdc2ec0507e15e466b.zip
LibWeb: Propagate layout mode of table formatting context to table cells
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout')
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp14
-rw-r--r--Userland/Libraries/LibWeb/Layout/TableFormattingContext.h2
2 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
index a56b3e0ca8..7f0f037bf2 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
@@ -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) {
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.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));
- VERIFY(independent_formatting_context);
- cell_state.set_content_height(independent_formatting_context->automatic_content_height());
- independent_formatting_context->parent_context_did_dimension_child_root_box();
+ if (auto independent_formatting_context = layout_inside(cell.box, layout_mode, cell_state.available_inner_space_or_constraints_from(*m_available_space))) {
+ cell_state.set_content_height(independent_formatting_context->automatic_content_height());
+ independent_formatting_context->parent_context_did_dimension_child_root_box();
+ }
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;
@@ -507,7 +507,7 @@ void TableFormattingContext::run(Box const& box, LayoutMode, AvailableSpace cons
// Distribute the width of the table among columns.
distribute_width_to_columns();
- calculate_row_heights();
+ calculate_row_heights(layout_mode);
position_row_boxes();
position_cell_boxes();
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h
index a709021976..3776ed82c0 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h
@@ -32,7 +32,7 @@ private:
void compute_table_width();
void distribute_width_to_columns();
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_cell_boxes();