mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02:00
LibWeb: Add support for CSS image-rendering property
Currently only "auto" and "pixelated" values are supported.
This commit is contained in:
Notes:
sideshowbarker
2024-07-17 18:32:59 +09:00
Author: https://github.com/sppmacd Commit: https://github.com/SerenityOS/serenity/commit/3e1c1c0b16 Pull-request: https://github.com/SerenityOS/serenity/pull/12620 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user