LibWeb: Start fleshing out support for relative CSS units

This patch introduces support for more than just "absolute px" units in
our Length class. It now also supports "em" and "rem", which are units
relative to the font-size of the current layout node and the <html>
element's layout node respectively.
This commit is contained in:
Andreas Kling 2020-06-07 17:55:46 +02:00
commit 731685468a
Notes: sideshowbarker 2024-07-19 05:47:10 +09:00
16 changed files with 163 additions and 92 deletions

View file

@ -190,7 +190,7 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
if (auto value = parse_line_style(parts[0])) {
set_property_border_style(style, value.release_nonnull());
set_property_border_color(style, ColorStyleValue::create(Gfx::Color::Black));
set_property_border_width(style, LengthStyleValue::create(Length(3, Length::Type::Absolute)));
set_property_border_width(style, LengthStyleValue::create(Length(3, Length::Type::Px)));
return;
}
}