summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
diff options
context:
space:
mode:
authorMaciej <sppmacd@pm.me>2022-02-18 12:21:27 +0100
committerAndreas Kling <kling@serenityos.org>2022-02-19 11:38:46 +0100
commit3e1c1c0b16a5af859172d46a361f3f995e87820b (patch)
treeaf7bdfbc096919c5c4a13c7545c1a23e27560fc6 /Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
parent246b42b63570c13479836b6862c83c423ed7ee7a (diff)
downloadserenity-3e1c1c0b16a5af859172d46a361f3f995e87820b.zip
LibWeb: Add support for CSS image-rendering property
Currently only "auto" and "pixelated" values are supported.
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 752c637665..fc496310db 100644
--- a/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
+++ b/Userland/Libraries/LibWeb/CSS/ResolvedCSSStyleDeclaration.cpp
@@ -358,6 +358,17 @@ static CSS::ValueID to_css_value_id(CSS::FlexWrap value)
VERIFY_NOT_REACHED();
}
+static CSS::ValueID to_css_value_id(CSS::ImageRendering value)
+{
+ switch (value) {
+ case ImageRendering::Auto:
+ return CSS::ValueID::Auto;
+ case ImageRendering::Pixelated:
+ return CSS::ValueID::Pixelated;
+ }
+ VERIFY_NOT_REACHED();
+}
+
static CSS::ValueID to_css_value_id(CSS::JustifyContent value)
{
switch (value) {
@@ -515,6 +526,8 @@ RefPtr<StyleValue> ResolvedCSSStyleDeclaration::style_value_for_property(Layout:
return NumericStyleValue::create_float(layout_node.computed_values().flex_shrink());
case CSS::PropertyID::Opacity:
return NumericStyleValue::create_float(layout_node.computed_values().opacity());
+ case CSS::PropertyID::ImageRendering:
+ return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().image_rendering()));
case CSS::PropertyID::JustifyContent:
return IdentifierStyleValue::create(to_css_value_id(layout_node.computed_values().justify_content()));
case CSS::PropertyID::BoxShadow: {