mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-29 04:37:55 +00:00
LibWeb: Move replaced element layout out of Layout::ReplacedBox
Replaced elements are now laid out by the current formatting context. Since the logic is almost identical in BFC and IFC, it's implemented by static helpers in FormattingContext.
This commit is contained in:
@@ -203,9 +203,9 @@ void InlineFormattingContext::run(Box&, LayoutMode layout_mode)
|
||||
void InlineFormattingContext::dimension_box_on_line(Box& box, LayoutMode layout_mode)
|
||||
{
|
||||
if (box.is_replaced()) {
|
||||
auto& replaced = const_cast<ReplacedBox&>(downcast<ReplacedBox>(box));
|
||||
replaced.set_width(replaced.calculate_width());
|
||||
replaced.set_height(replaced.calculate_height());
|
||||
auto& replaced = downcast<ReplacedBox>(box);
|
||||
replaced.set_width(compute_width_for_replaced_element(replaced));
|
||||
replaced.set_height(compute_height_for_replaced_element(replaced));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user