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

LibWeb: Use the new to_px() helpers in CSS, SVG and layout code

There should be no behavior change from this, only slightly less
verbosity. :^)
This commit is contained in:
Andreas Kling 2023-05-06 16:34:55 +02:00
parent cdf0d3e905
commit ca1fa5f748
14 changed files with 141 additions and 149 deletions

View file

@ -646,14 +646,14 @@ void BlockFormattingContext::resolve_vertical_box_model_metrics(Box const& box,
{
auto& box_state = state.get_mutable(box);
auto const& computed_values = box.computed_values();
auto width_of_containing_block = CSS::Length::make_px(containing_block_width_for(box, state));
auto width_of_containing_block = containing_block_width_for(box, state);
box_state.margin_top = computed_values.margin().top().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);
box_state.margin_top = computed_values.margin().top().to_px(box, width_of_containing_block);
box_state.margin_bottom = computed_values.margin().bottom().to_px(box, width_of_containing_block);
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).to_px(box);
box_state.padding_bottom = computed_values.padding().bottom().resolved(box, width_of_containing_block).to_px(box);
box_state.padding_top = computed_values.padding().top().to_px(box, width_of_containing_block);
box_state.padding_bottom = computed_values.padding().bottom().to_px(box, width_of_containing_block);
}
CSSPixels BlockFormattingContext::BlockMarginState::current_collapsed_margin() const