1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:38:11 +00:00

LibWeb: Remove Layout::Box::width_of_logical_containing_block()

This was a hack to percentages within tables relative to the nearest
table-row ancestor instead of the nearest table container.

That didn't actually make sense, so this patch simply removes the hack
in favor of containing_block()->width().
This commit is contained in:
Andreas Kling 2021-10-27 18:00:51 +02:00
parent 4333d0d639
commit ca154723f7
6 changed files with 4 additions and 23 deletions

View file

@ -120,7 +120,7 @@ void BlockFormattingContext::compute_width(Box& box)
}
auto& computed_values = box.computed_values();
float width_of_containing_block = box.width_of_logical_containing_block();
float width_of_containing_block = box.containing_block()->width();
auto zero_value = CSS::Length::make_px(0);
@ -242,7 +242,7 @@ void BlockFormattingContext::compute_width_for_floating_box(Box& box)
{
// 10.3.5 Floating, non-replaced elements
auto& computed_values = box.computed_values();
float width_of_containing_block = box.width_of_logical_containing_block();
float width_of_containing_block = box.containing_block()->width();
auto zero_value = CSS::Length::make_px(0);
auto margin_left = computed_values.margin().left.resolved_or_zero(box, width_of_containing_block);
@ -389,7 +389,7 @@ void BlockFormattingContext::compute_position(Box& box)
auto& box_model = box.box_model();
auto& computed_values = box.computed_values();
float width_of_containing_block = box.width_of_logical_containing_block();
float width_of_containing_block = box.containing_block()->width();
auto specified_left = computed_values.offset().left.resolved_or_zero(box, width_of_containing_block);
auto specified_right = computed_values.offset().right.resolved_or_zero(box, width_of_containing_block);