diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2021-10-05 16:55:02 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-05 18:49:47 +0200 |
commit | fc7af21c7c0988ccbc786c5d88ff333175034a2f (patch) | |
tree | c409fcbadd80b11515e707a7d4c069eb6bb851ca /Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp | |
parent | 3c192f492a9a5696d5e84ebf7d811bce3f3d28a4 (diff) | |
download | serenity-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.cpp | 13 |
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: |