summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2021-10-05 16:55:02 +0100
committerAndreas Kling <kling@serenityos.org>2021-10-05 18:49:47 +0200
commitfc7af21c7c0988ccbc786c5d88ff333175034a2f (patch)
treec409fcbadd80b11515e707a7d4c069eb6bb851ca /Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
parent3c192f492a9a5696d5e84ebf7d811bce3f3d28a4 (diff)
downloadserenity-fc7af21c7c0988ccbc786c5d88ff333175034a2f.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp')
-rw-r--r--Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
index 89dbc77f35..6ab3388d13 100644
--- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
+++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
@@ -33,6 +33,17 @@ String ResolvedCSSStyleDeclaration::item(size_t index) const
return {};
}
+static CSS::ValueID to_css_value_id(CSS::BoxSizing value)
+{
+ switch (value) {
+ case CSS::BoxSizing::BorderBox:
+ return CSS::ValueID::BorderBox;
+ case CSS::BoxSizing::ContentBox:
+ return CSS::ValueID::ContentBox;
+ }
+ VERIFY_NOT_REACHED();
+}
+
static CSS::ValueID to_css_value_id(CSS::Display value)
{
switch (value) {
@@ -546,6 +557,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
}
case CSS::PropertyID::ListStyleType:
return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().list_style_type()));
+ case CSS::PropertyID::BoxSizing:
+ return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().box_sizing()));
case CSS::PropertyID::Invalid:
return IdentifierStyleValue::create(CSS::ValueID::Invalid);
case CSS::PropertyID::Custom: