diff options
author | Andreas Kling <kling@serenityos.org> | 2020-12-14 10:52:51 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-12-14 10:53:40 +0100 |
commit | 19144b753a24ffabd50a31cf0f45db463e80eeb4 (patch) | |
tree | 106895e652c5d6ca58467953226de0b213e0ae7a /Libraries/LibWeb | |
parent | 3c9dcec44275d20bea1ac79ee64a4f213c152101 (diff) | |
download | serenity-19144b753a24ffabd50a31cf0f45db463e80eeb4.zip |
LibWeb: Make StyleProperties::length_box() default to auto values
Undefined length values can default to auto in all length boxes and
we'll get the values we need. This saves us from having to deal with
undefined lengths later on in layout.
At some point we should break the style application process into
a few more formal steps, but this at least simplifies some things.
Diffstat (limited to 'Libraries/LibWeb')
-rw-r--r-- | Libraries/LibWeb/CSS/StyleProperties.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Libraries/LibWeb/CSS/StyleProperties.cpp b/Libraries/LibWeb/CSS/StyleProperties.cpp index 3598bf7148..b95167dfa1 100644 --- a/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -79,10 +79,10 @@ Length StyleProperties::length_or_fallback(CSS::PropertyID id, const Length& fal LengthBox StyleProperties::length_box(CSS::PropertyID left_id, CSS::PropertyID top_id, CSS::PropertyID right_id, CSS::PropertyID bottom_id) const { LengthBox box; - box.left = length_or_fallback(left_id, {}); - box.top = length_or_fallback(top_id, {}); - box.right = length_or_fallback(right_id, {}); - box.bottom = length_or_fallback(bottom_id, {}); + box.left = length_or_fallback(left_id, CSS::Length::make_auto()); + box.top = length_or_fallback(top_id, CSS::Length::make_auto()); + box.right = length_or_fallback(right_id, CSS::Length::make_auto()); + box.bottom = length_or_fallback(bottom_id, CSS::Length::make_auto()); return box; } |