1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-18 21:25:07 +00:00

LibWeb: Move the offset, margin and padding boxes into LayoutStyle

This commit is contained in:
Andreas Kling 2020-06-24 17:45:42 +02:00
parent 6b334e02e6
commit 4b2ac34725
9 changed files with 66 additions and 79 deletions

View file

@ -45,12 +45,11 @@ float LayoutReplaced::calculate_width() const
{
// 10.3.2 [Inline,] replaced elements
auto& specified_style = this->specified_style();
auto zero_value = Length::make_px(0);
auto& containing_block = *this->containing_block();
auto margin_left = specified_style.length_or_fallback(CSS::PropertyID::MarginLeft, zero_value, containing_block.width());
auto margin_right = specified_style.length_or_fallback(CSS::PropertyID::MarginRight, zero_value, containing_block.width());
auto margin_left = style().margin().left.resolved_or_zero(*this, containing_block.width());
auto margin_right = style().margin().right.resolved_or_zero(*this, containing_block.width());
// A computed value of 'auto' for 'margin-left' or 'margin-right' becomes a used value of '0'.
if (margin_left.is_auto())