1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 01:51:03 +09:00

LibWeb: Make things aware of box-sizing

Of course, we don't actually *use* the box-sizing property yet, but the
value is applied and shows up in the computed style.
This commit is contained in:
Sam Atkins 2021-10-05 16:55:02 +01:00 committed by Andreas Kling
parent 3c192f492a
commit fc7af21c7c
Notes: sideshowbarker 2024-07-18 03:01:37 +09:00
6 changed files with 41 additions and 0 deletions

View file

@ -728,4 +728,20 @@ Optional<CSS::BoxShadowData> StyleProperties::box_shadow() const
auto& box = value->as_box_shadow();
return { { box.offset_x(), box.offset_y(), box.blur_radius(), box.color() } };
}
CSS::BoxSizing StyleProperties::box_sizing() const
{
auto value = property(CSS::PropertyID::BoxSizing);
if (!value.has_value())
return {};
switch (value.value()->to_identifier()) {
case CSS::ValueID::BorderBox:
return CSS::BoxSizing::BorderBox;
case CSS::ValueID::ContentBox:
return CSS::BoxSizing::ContentBox;
default:
return {};
}
}
}