1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:17:45 +00:00

LibWeb: Remove default Length constructor and add make_auto()/make_px()

To prepare for adding an undefined/empty state for Length, let's first
move away from Length() creating an auto value.
This commit is contained in:
Andreas Kling 2020-06-24 11:08:46 +02:00
parent 26eef65017
commit 5744dd43c5
7 changed files with 60 additions and 58 deletions

View file

@ -46,8 +46,8 @@ float LayoutReplaced::calculate_width() const
// 10.3.2 [Inline,] replaced elements
auto& style = this->style();
auto auto_value = Length();
auto zero_value = Length(0, Length::Type::Px);
auto auto_value = Length::make_auto();
auto zero_value = Length::make_px(0);
auto& containing_block = *this->containing_block();
auto margin_left = style.length_or_fallback(CSS::PropertyID::MarginLeft, zero_value, containing_block.width());
@ -99,7 +99,7 @@ float LayoutReplaced::calculate_height() const
// 10.6.2 Inline replaced elements, block-level replaced elements in normal flow,
// 'inline-block' replaced elements in normal flow and floating replaced elements
auto& style = this->style();
auto auto_value = Length();
auto auto_value = Length::make_auto();
auto& containing_block = *this->containing_block();
auto specified_width = style.length_or_fallback(CSS::PropertyID::Width, auto_value, containing_block.width());