1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 08:07:44 +00:00

LibWeb: Resolve cyclic declaration/definitions involving Length

This remained undetected for a long time as HeaderCheck is disabled by
default. This commit makes the following file compile again:

    // file: compile_me.cpp
    #include <LibWeb/CSS/GridTrackSize.h>
    // That's it, this was enough to cause a compilation error.
This commit is contained in:
Ben Wiederhake 2022-09-13 17:42:39 +02:00 committed by Sam Atkins
parent 53eb35caba
commit 8deced39a8
15 changed files with 192 additions and 125 deletions

View file

@ -103,13 +103,13 @@ void BlockFormattingContext::compute_width(Box const& box, LayoutMode layout_mod
auto margin_left = CSS::Length::make_auto();
auto margin_right = CSS::Length::make_auto();
auto padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
auto padding_left = computed_values.padding().left().resolved(box, width_of_containing_block_as_length).resolved(box);
auto padding_right = computed_values.padding().right().resolved(box, width_of_containing_block_as_length).resolved(box);
auto try_compute_width = [&](auto const& a_width) {
CSS::Length width = a_width;
margin_left = computed_values.margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
margin_right = computed_values.margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
margin_left = computed_values.margin().left().resolved(box, width_of_containing_block_as_length).resolved(box);
margin_right = computed_values.margin().right().resolved(box, width_of_containing_block_as_length).resolved(box);
float total_px = computed_values.border_left().width + computed_values.border_right().width;
for (auto& value : { margin_left, padding_left, width, padding_right, margin_right }) {
total_px += value.to_px(box);
@ -245,10 +245,10 @@ void BlockFormattingContext::compute_width_for_floating_box(Box const& box, Layo
auto width_of_containing_block_as_length = CSS::Length::make_px(width_of_containing_block);
auto zero_value = CSS::Length::make_px(0);
auto margin_left = computed_values.margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_right = computed_values.margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
auto const padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto const padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_left = computed_values.margin().left().resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_right = computed_values.margin().right().resolved(box, width_of_containing_block_as_length).resolved(box);
auto const padding_left = computed_values.padding().left().resolved(box, width_of_containing_block_as_length).resolved(box);
auto const padding_right = computed_values.padding().right().resolved(box, width_of_containing_block_as_length).resolved(box);
// If 'margin-left', or 'margin-right' are computed as 'auto', their used value is '0'.
if (margin_left.is_auto())
@ -351,13 +351,13 @@ void BlockFormattingContext::compute_height(Box const& box, LayoutState& state)
auto& box_state = state.get_mutable(box);
box_state.margin_top = computed_values.margin().top.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_top = computed_values.margin().top().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.border_top = computed_values.border_top().width;
box_state.border_bottom = computed_values.border_bottom().width;
box_state.padding_top = computed_values.padding().top.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_top = computed_values.padding().top().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.set_content_height(compute_theoretical_height(state, box));
}
@ -499,12 +499,12 @@ void BlockFormattingContext::compute_vertical_box_model_metrics(Box const& box,
auto const& computed_values = box.computed_values();
auto width_of_containing_block = CSS::Length::make_px(containing_block_width_for(box));
box_state.margin_top = computed_values.margin().top.resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom.resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.margin_top = computed_values.margin().top().resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom().resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.border_top = computed_values.border_top().width;
box_state.border_bottom = computed_values.border_bottom().width;
box_state.padding_top = computed_values.padding().top.resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom.resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.padding_top = computed_values.padding().top().resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom().resolved(box, width_of_containing_block).resolved(containing_block).to_px(box);
}
void BlockFormattingContext::place_block_level_element_in_normal_flow_vertically(Box const& child_box, BlockContainer const& containing_block)

View file

@ -226,40 +226,40 @@ void FlexFormattingContext::populate_specified_margins(FlexItem& item, CSS::Flex
item.borders.cross_before = item.box.computed_values().border_top().width;
item.borders.cross_after = item.box.computed_values().border_bottom().width;
item.padding.main_before = item.box.computed_values().padding().left.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_after = item.box.computed_values().padding().right.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_before = item.box.computed_values().padding().top.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_after = item.box.computed_values().padding().bottom.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_before = item.box.computed_values().padding().left().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_after = item.box.computed_values().padding().right().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_before = item.box.computed_values().padding().top().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_after = item.box.computed_values().padding().bottom().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before = item.box.computed_values().margin().left.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_after = item.box.computed_values().margin().right.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_before = item.box.computed_values().margin().top.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_after = item.box.computed_values().margin().bottom.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before = item.box.computed_values().margin().left().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_after = item.box.computed_values().margin().right().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_before = item.box.computed_values().margin().top().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_after = item.box.computed_values().margin().bottom().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before_is_auto = item.box.computed_values().margin().left.is_auto();
item.margins.main_after_is_auto = item.box.computed_values().margin().right.is_auto();
item.margins.cross_before_is_auto = item.box.computed_values().margin().top.is_auto();
item.margins.cross_after_is_auto = item.box.computed_values().margin().bottom.is_auto();
item.margins.main_before_is_auto = item.box.computed_values().margin().left().is_auto();
item.margins.main_after_is_auto = item.box.computed_values().margin().right().is_auto();
item.margins.cross_before_is_auto = item.box.computed_values().margin().top().is_auto();
item.margins.cross_after_is_auto = item.box.computed_values().margin().bottom().is_auto();
} else {
item.borders.main_before = item.box.computed_values().border_top().width;
item.borders.main_after = item.box.computed_values().border_bottom().width;
item.borders.cross_before = item.box.computed_values().border_left().width;
item.borders.cross_after = item.box.computed_values().border_right().width;
item.padding.main_before = item.box.computed_values().padding().top.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_after = item.box.computed_values().padding().bottom.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_before = item.box.computed_values().padding().left.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_after = item.box.computed_values().padding().right.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_before = item.box.computed_values().padding().top().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.main_after = item.box.computed_values().padding().bottom().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_before = item.box.computed_values().padding().left().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.padding.cross_after = item.box.computed_values().padding().right().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before = item.box.computed_values().margin().top.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_after = item.box.computed_values().margin().bottom.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_before = item.box.computed_values().margin().left.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_after = item.box.computed_values().margin().right.resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before = item.box.computed_values().margin().top().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_after = item.box.computed_values().margin().bottom().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_before = item.box.computed_values().margin().left().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.cross_after = item.box.computed_values().margin().right().resolved(item.box, width_of_containing_block_as_length).to_px(item.box);
item.margins.main_before_is_auto = item.box.computed_values().margin().top.is_auto();
item.margins.main_after_is_auto = item.box.computed_values().margin().bottom.is_auto();
item.margins.cross_before_is_auto = item.box.computed_values().margin().left.is_auto();
item.margins.cross_after_is_auto = item.box.computed_values().margin().right.is_auto();
item.margins.main_before_is_auto = item.box.computed_values().margin().top().is_auto();
item.margins.main_after_is_auto = item.box.computed_values().margin().bottom().is_auto();
item.margins.cross_before_is_auto = item.box.computed_values().margin().left().is_auto();
item.margins.cross_after_is_auto = item.box.computed_values().margin().right().is_auto();
}
};
@ -1389,15 +1389,15 @@ void FlexFormattingContext::copy_dimensions_from_flex_items_to_boxes()
auto const& box = flex_item.box;
auto& box_state = m_state.get_mutable(box);
box_state.padding_left = box.computed_values().padding().left.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_right = box.computed_values().padding().right.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_top = box.computed_values().padding().top.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_bottom = box.computed_values().padding().bottom.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_left = box.computed_values().padding().left().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_right = box.computed_values().padding().right().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_top = box.computed_values().padding().top().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.padding_bottom = box.computed_values().padding().bottom().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_left = box.computed_values().margin().left.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_right = box.computed_values().margin().right.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_top = box.computed_values().margin().top.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_bottom = box.computed_values().margin().bottom.resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_left = box.computed_values().margin().left().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_right = box.computed_values().margin().right().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_top = box.computed_values().margin().top().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.margin_bottom = box.computed_values().margin().bottom().resolved(box, CSS::Length::make_px(m_flex_container_state.content_width())).to_px(box);
box_state.border_left = box.computed_values().border_left().width;
box_state.border_right = box.computed_values().border_right().width;

View file

@ -422,8 +422,8 @@ float FormattingContext::compute_width_for_replaced_element(LayoutState const& s
auto zero_value = CSS::Length::make_px(0);
auto width_of_containing_block_as_length = CSS::Length::make_px(containing_block_width_for(box, state));
auto margin_left = box.computed_values().margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_right = box.computed_values().margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_left = box.computed_values().margin().left().resolved(box, width_of_containing_block_as_length).resolved(box);
auto margin_right = box.computed_values().margin().right().resolved(box, width_of_containing_block_as_length).resolved(box);
// A computed value of 'auto' for 'margin-left' or 'margin-right' becomes a used value of '0'.
if (margin_left.is_auto())
@ -519,15 +519,15 @@ void FormattingContext::compute_width_for_absolutely_positioned_non_replaced_ele
auto margin_right = CSS::Length::make_auto();
auto const border_left = computed_values.border_left().width;
auto const border_right = computed_values.border_right().width;
auto const padding_left = computed_values.padding().left.resolved(box, width_of_containing_block_as_length).to_px(box);
auto const padding_right = computed_values.padding().right.resolved(box, width_of_containing_block_as_length).to_px(box);
auto const padding_left = computed_values.padding().left().resolved(box, width_of_containing_block_as_length).to_px(box);
auto const padding_right = computed_values.padding().right().resolved(box, width_of_containing_block_as_length).to_px(box);
auto try_compute_width = [&](auto const& a_width) {
margin_left = computed_values.margin().left.resolved(box, width_of_containing_block_as_length).resolved(box);
margin_right = computed_values.margin().right.resolved(box, width_of_containing_block_as_length).resolved(box);
margin_left = computed_values.margin().left().resolved(box, width_of_containing_block_as_length).resolved(box);
margin_right = computed_values.margin().right().resolved(box, width_of_containing_block_as_length).resolved(box);
auto left = computed_values.inset().left.resolved(box, width_of_containing_block_as_length).resolved(box);
auto right = computed_values.inset().right.resolved(box, width_of_containing_block_as_length).resolved(box);
auto left = computed_values.inset().left().resolved(box, width_of_containing_block_as_length).resolved(box);
auto right = computed_values.inset().right().resolved(box, width_of_containing_block_as_length).resolved(box);
auto width = a_width;
auto solve_for_left = [&] {
@ -672,8 +672,8 @@ void FormattingContext::compute_height_for_absolutely_positioned_non_replaced_el
auto width_of_containing_block_as_length = CSS::Length::make_px(width_of_containing_block);
auto height_of_containing_block_as_length = CSS::Length::make_px(height_of_containing_block);
auto const& computed_top = computed_values.inset().top;
auto const& computed_bottom = computed_values.inset().bottom;
auto const& computed_top = computed_values.inset().top();
auto const& computed_bottom = computed_values.inset().bottom();
auto const& computed_height = computed_values.height();
auto const& computed_min_height = computed_values.min_height();
auto const& computed_max_height = computed_values.max_height();
@ -686,12 +686,12 @@ void FormattingContext::compute_height_for_absolutely_positioned_non_replaced_el
tentative_height = computed_values.height().resolved(box, height_of_containing_block_as_length).resolved(box);
auto& box_state = m_state.get_mutable(box);
box_state.margin_top = computed_values.margin().top.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_top = computed_values.margin().top().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.border_top = computed_values.border_top().width;
box_state.border_bottom = computed_values.border_bottom().width;
box_state.padding_top = computed_values.padding().top.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_top = computed_values.padding().top().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom().resolved(box, width_of_containing_block_as_length).to_px(box);
if (computed_height.is_auto() && computed_top.is_auto() && computed_bottom.is_auto()) {
tentative_height = CSS::Length(compute_auto_height_for_block_level_element(m_state, box), CSS::Length::Type::Px);
@ -738,25 +738,25 @@ void FormattingContext::layout_absolutely_positioned_element(Box const& box)
compute_height_for_absolutely_positioned_element(box);
auto& box_state = m_state.get_mutable(box);
box_state.margin_left = box.computed_values().margin().left.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_top = box.computed_values().margin().top.resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.margin_right = box.computed_values().margin().right.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = box.computed_values().margin().bottom.resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.margin_left = box.computed_values().margin().left().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_top = box.computed_values().margin().top().resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.margin_right = box.computed_values().margin().right().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.margin_bottom = box.computed_values().margin().bottom().resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.border_left = box.computed_values().border_left().width;
box_state.border_right = box.computed_values().border_right().width;
box_state.border_top = box.computed_values().border_top().width;
box_state.border_bottom = box.computed_values().border_bottom().width;
box_state.inset_left = box.computed_values().inset().left.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.inset_top = box.computed_values().inset().top.resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.inset_right = box.computed_values().inset().right.resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.inset_bottom = box.computed_values().inset().bottom.resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.inset_left = box.computed_values().inset().left().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.inset_top = box.computed_values().inset().top().resolved(box, height_of_containing_block_as_length).to_px(box);
box_state.inset_right = box.computed_values().inset().right().resolved(box, width_of_containing_block_as_length).to_px(box);
box_state.inset_bottom = box.computed_values().inset().bottom().resolved(box, height_of_containing_block_as_length).to_px(box);
if (box.computed_values().inset().left.is_auto() && specified_width.is_auto() && box.computed_values().inset().right.is_auto()) {
if (box.computed_values().margin().left.is_auto())
if (box.computed_values().inset().left().is_auto() && specified_width.is_auto() && box.computed_values().inset().right().is_auto()) {
if (box.computed_values().margin().left().is_auto())
box_state.margin_left = 0;
if (box.computed_values().margin().right.is_auto())
if (box.computed_values().margin().right().is_auto())
box_state.margin_right = 0;
}
@ -772,11 +772,11 @@ void FormattingContext::layout_absolutely_positioned_element(Box const& box)
}
auto parent_location = absolute_content_rect(static_cast<Box const&>(*relevant_parent), m_state);
if (!box.computed_values().inset().left.is_auto()) {
if (!box.computed_values().inset().left().is_auto()) {
float x_offset = box_state.inset_left
+ box_state.border_box_left();
used_offset.set_x(x_offset + box_state.margin_left);
} else if (!box.computed_values().inset().right.is_auto()) {
} else if (!box.computed_values().inset().right().is_auto()) {
float x_offset = 0
- box_state.inset_right
- box_state.border_box_right();
@ -787,11 +787,11 @@ void FormattingContext::layout_absolutely_positioned_element(Box const& box)
used_offset.set_x(x_offset);
}
if (!box.computed_values().inset().top.is_auto()) {
if (!box.computed_values().inset().top().is_auto()) {
float y_offset = box_state.inset_top
+ box_state.border_box_top();
used_offset.set_y(y_offset + box_state.margin_top);
} else if (!box.computed_values().inset().bottom.is_auto()) {
} else if (!box.computed_values().inset().bottom().is_auto()) {
float y_offset = 0
- box_state.inset_bottom
- box_state.border_box_bottom();
@ -855,8 +855,8 @@ void FormattingContext::compute_inset(Box const& box)
auto const& computed_values = box.computed_values();
// FIXME: Respect the containing block's writing-mode.
resolve_two_opposing_insets(computed_values.inset().left, computed_values.inset().right, box_state.inset_left, box_state.inset_right, containing_block_width_for(box));
resolve_two_opposing_insets(computed_values.inset().top, computed_values.inset().bottom, box_state.inset_top, box_state.inset_bottom, containing_block_height_for(box));
resolve_two_opposing_insets(computed_values.inset().left(), computed_values.inset().right(), box_state.inset_left, box_state.inset_right, containing_block_width_for(box));
resolve_two_opposing_insets(computed_values.inset().top(), computed_values.inset().bottom(), box_state.inset_top, box_state.inset_bottom, containing_block_height_for(box));
}
float FormattingContext::calculate_fit_content_size(float min_content_size, float max_content_size, SizeConstraint constraint, Optional<float> available_space) const

View file

@ -90,21 +90,21 @@ void InlineFormattingContext::dimension_box_on_line(Box const& box, LayoutMode l
auto& box_state = m_state.get_mutable(box);
auto const& computed_values = box.computed_values();
box_state.margin_left = computed_values.margin().left.resolved(box, width_of_containing_block).to_px(box);
box_state.margin_left = computed_values.margin().left().resolved(box, width_of_containing_block).to_px(box);
box_state.border_left = computed_values.border_left().width;
box_state.padding_left = computed_values.padding().left.resolved(box, width_of_containing_block).to_px(box);
box_state.padding_left = computed_values.padding().left().resolved(box, width_of_containing_block).to_px(box);
box_state.margin_right = computed_values.margin().right.resolved(box, width_of_containing_block).to_px(box);
box_state.margin_right = computed_values.margin().right().resolved(box, width_of_containing_block).to_px(box);
box_state.border_right = computed_values.border_right().width;
box_state.padding_right = computed_values.padding().right.resolved(box, width_of_containing_block).to_px(box);
box_state.padding_right = computed_values.padding().right().resolved(box, width_of_containing_block).to_px(box);
box_state.margin_top = computed_values.margin().top.resolved(box, width_of_containing_block).to_px(box);
box_state.margin_top = computed_values.margin().top().resolved(box, width_of_containing_block).to_px(box);
box_state.border_top = computed_values.border_top().width;
box_state.padding_top = computed_values.padding().top.resolved(box, width_of_containing_block).to_px(box);
box_state.padding_top = computed_values.padding().top().resolved(box, width_of_containing_block).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom.resolved(box, width_of_containing_block).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom().resolved(box, width_of_containing_block).to_px(box);
box_state.border_bottom = computed_values.border_bottom().width;
box_state.margin_bottom = computed_values.margin().bottom.resolved(box, width_of_containing_block).to_px(box);
box_state.margin_bottom = computed_values.margin().bottom().resolved(box, width_of_containing_block).to_px(box);
if (is<ReplacedBox>(box)) {
auto& replaced = verify_cast<ReplacedBox>(box);

View file

@ -34,9 +34,9 @@ void InlineLevelIterator::enter_node_with_box_model_metrics(Layout::NodeWithStyl
auto& used_values = m_layout_state.get_mutable(node);
auto const& computed_values = node.computed_values();
used_values.margin_left = computed_values.margin().left.resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.margin_left = computed_values.margin().left().resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.border_left = computed_values.border_left().width;
used_values.padding_left = computed_values.padding().left.resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.padding_left = computed_values.padding().left().resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
m_extra_leading_metrics->margin += used_values.margin_left;
m_extra_leading_metrics->border += used_values.border_left;
@ -54,9 +54,9 @@ void InlineLevelIterator::exit_node_with_box_model_metrics()
auto& used_values = m_layout_state.get_mutable(node);
auto const& computed_values = node.computed_values();
used_values.margin_right = computed_values.margin().right.resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.margin_right = computed_values.margin().right().resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.border_right = computed_values.border_right().width;
used_values.padding_right = computed_values.padding().right.resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
used_values.padding_right = computed_values.padding().right().resolved(node, CSS::Length::make_px(m_container_state.content_width())).to_px(node);
m_extra_trailing_metrics->margin += used_values.margin_right;
m_extra_trailing_metrics->border += used_values.border_right;