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

LibWeb: Move line-height from NodeWithStyle to ComputedValues

There's no need for this to live in the NodeWithStyle anymore. By moving
it to ComputedValues we get all the right inheritance behavior for free.
This commit is contained in:
Andreas Kling 2024-01-12 15:34:13 +01:00
parent e7de5cb4d2
commit c82d517447
8 changed files with 20 additions and 24 deletions

View file

@ -420,7 +420,6 @@ ErrorOr<void> TreeBuilder::create_layout_tree(DOM::Node& dom_node, TreeBuilder::
auto content_box_computed_values = parent.computed_values().clone_inherited_values();
auto content_box_wrapper = parent.heap().template allocate_without_realm<BlockContainer>(parent.document(), nullptr, move(content_box_computed_values));
content_box_wrapper->set_font_list(parent.font_list());
content_box_wrapper->set_line_height(parent.line_height());
content_box_wrapper->set_children_are_inline(parent.children_are_inline());
Vector<JS::Handle<Node>> sequence;
@ -621,7 +620,6 @@ static void wrap_in_anonymous(Vector<JS::Handle<Node>>& sequence, Node* nearest_
wrapper->append_child(*child);
}
wrapper->set_children_are_inline(parent.children_are_inline());
wrapper->set_line_height(parent.line_height());
wrapper->set_font_list(parent.font_list());
if (nearest_sibling)
parent.insert_before(*wrapper, *nearest_sibling);
@ -710,7 +708,6 @@ Vector<JS::Handle<Box>> TreeBuilder::generate_missing_parents(NodeWithStyle& roo
parent.remove_child(*table_box);
wrapper->append_child(*table_box);
wrapper->set_font_list(parent.font_list());
wrapper->set_line_height(parent.line_height());
if (nearest_sibling)
parent.insert_before(*wrapper, *nearest_sibling);
@ -746,7 +743,6 @@ static void fixup_row(Box& row_box, TableGrid const& table_grid, size_t row_inde
cell_computed_values.set_vertical_align(CSS::VerticalAlign::Middle);
auto cell_box = row_box.heap().template allocate_without_realm<BlockContainer>(row_box.document(), nullptr, cell_computed_values);
cell_box->set_font_list(row_box.font_list());
cell_box->set_line_height(row_box.line_height());
row_box.append_child(cell_box);
}
}