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

LibWeb: Move width into LayoutStyle

This patch also adds the ability for Length to contain percentage
values. This is a little off-spec, but will make storing and dealing
with lengths a lot easier.

To resolve a Length to a px-or-auto Length, there are now helpers
for that. After calling them, you no longer have to think about
em, rem, %, and such things.
This commit is contained in:
Andreas Kling 2020-06-24 15:38:21 +02:00
parent 959464fce4
commit ecacab8618
6 changed files with 53 additions and 29 deletions

View file

@ -226,6 +226,7 @@ void LayoutNodeWithStyle::apply_style(const StyleProperties& specified_style)
style.set_position(specified_style.position());
style.set_text_align(specified_style.text_align());
style.set_z_index(specified_style.z_index());
style.set_width(specified_style.length_or_fallback(CSS::PropertyID::Width, {}));
}
}