summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb
diff options
context:
space:
mode:
authorItamar <itamar8910@gmail.com>2022-11-14 21:18:52 +0200
committerSam Atkins <atkinssj@gmail.com>2022-11-14 21:22:27 +0000
commit8d65df935e86653f06b21b847a0f138b3fa49d47 (patch)
tree322be6a2403a39cf7882f5c277e393b8d1874a2d /Userland/Libraries/LibWeb
parent826d5f8f9ab0e28606a0d07847056bd6562ebc49 (diff)
downloadserenity-8d65df935e86653f06b21b847a0f138b3fa49d47.zip
LibWeb: Handle inset properties in style_value_for_property()
This adds support for the Top, Right, Bottom and Left CSS properties in style_value_for_property().
Diffstat (limited to 'Userland/Libraries/LibWeb')
-rw-r--r--Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
index 909e544fe9..8445a6d9fc 100644
--- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
+++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
@@ -293,6 +293,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
}
case CSS::PropertyID::BoxSizing:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().box_sizing()));
+ case CSS::PropertyID::Bottom:
+ return style_value_for_length_percentage(layout_node.computed_values().inset().bottom());
case CSS::PropertyID::Clear:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().clear()));
case CSS::PropertyID::Clip:
@@ -373,6 +375,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().image_rendering()));
case CSS::PropertyID::JustifyContent:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().justify_content()));
+ case CSS::PropertyID::Left:
+ return style_value_for_length_percentage(layout_node.computed_values().inset().left());
case CSS::PropertyID::ListStyleType:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().list_style_type()));
case CSS::PropertyID::Margin: {
@@ -427,6 +431,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return style_value_for_length_percentage(layout_node.computed_values().padding().top());
case CSS::PropertyID::Position:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().position()));
+ case CSS::PropertyID::Right:
+ return style_value_for_length_percentage(layout_node.computed_values().inset().right());
case CSS::PropertyID::RowGap:
return style_value_for_size(layout_node.computed_values().row_gap());
case CSS::PropertyID::TextAlign:
@@ -445,6 +451,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().text_decoration_style()));
case CSS::PropertyID::TextTransform:
return IdentifierStyleValue::create(to_value_id(layout_node.computed_values().text_transform()));
+ case CSS::PropertyID::Top:
+ return style_value_for_length_percentage(layout_node.computed_values().inset().top());
case CSS::PropertyID::Transform: {
// NOTE: The computed value for `transform` serializes as a single `matrix(...)` value, instead of
// the original list of transform functions. So, we produce a StyleValue for that.