mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 18:17:44 +00:00
LibWeb: Add 'object-fit' property
This patch adds support for the 'object-fit' CSS property. :^)
This commit is contained in:
parent
86ad896f35
commit
5fc6bff582
6 changed files with 24 additions and 0 deletions
|
@ -106,6 +106,7 @@ public:
|
||||||
static CSS::BorderCollapse border_collapse() { return CSS::BorderCollapse::Separate; }
|
static CSS::BorderCollapse border_collapse() { return CSS::BorderCollapse::Separate; }
|
||||||
static Vector<Vector<String>> grid_template_areas() { return {}; }
|
static Vector<Vector<String>> grid_template_areas() { return {}; }
|
||||||
static CSS::Time transition_delay() { return CSS::Time::make_seconds(0); }
|
static CSS::Time transition_delay() { return CSS::Time::make_seconds(0); }
|
||||||
|
static CSS::ObjectFit object_fit() { return CSS::ObjectFit::Fill; }
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class BackgroundSize {
|
enum class BackgroundSize {
|
||||||
|
|
|
@ -238,6 +238,13 @@
|
||||||
"inside",
|
"inside",
|
||||||
"outside"
|
"outside"
|
||||||
],
|
],
|
||||||
|
"object-fit": [
|
||||||
|
"fill",
|
||||||
|
"contain",
|
||||||
|
"cover",
|
||||||
|
"none",
|
||||||
|
"scale-down"
|
||||||
|
],
|
||||||
"overflow": [
|
"overflow": [
|
||||||
"auto",
|
"auto",
|
||||||
"clip",
|
"clip",
|
||||||
|
|
|
@ -131,6 +131,7 @@
|
||||||
"fantasy",
|
"fantasy",
|
||||||
"fast",
|
"fast",
|
||||||
"fine",
|
"fine",
|
||||||
|
"fill",
|
||||||
"fit-content",
|
"fit-content",
|
||||||
"fixed",
|
"fixed",
|
||||||
"flex",
|
"flex",
|
||||||
|
@ -262,6 +263,7 @@
|
||||||
"s-resize",
|
"s-resize",
|
||||||
"safe",
|
"safe",
|
||||||
"sans-serif",
|
"sans-serif",
|
||||||
|
"scale-down",
|
||||||
"scroll",
|
"scroll",
|
||||||
"se-resize",
|
"se-resize",
|
||||||
"self-end",
|
"self-end",
|
||||||
|
|
|
@ -1559,6 +1559,13 @@
|
||||||
"unitless-length"
|
"unitless-length"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"object-fit": {
|
||||||
|
"inherited": false,
|
||||||
|
"initial": "fill",
|
||||||
|
"valid-types": [
|
||||||
|
"object-fit"
|
||||||
|
]
|
||||||
|
},
|
||||||
"opacity": {
|
"opacity": {
|
||||||
"affects-layout": false,
|
"affects-layout": false,
|
||||||
"affects-stacking-context": true,
|
"affects-stacking-context": true,
|
||||||
|
|
|
@ -937,6 +937,12 @@ String StyleProperties::grid_area() const
|
||||||
return value->as_string().to_string().release_value_but_fixme_should_propagate_errors();
|
return value->as_string().to_string().release_value_but_fixme_should_propagate_errors();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Optional<CSS::ObjectFit> StyleProperties::object_fit() const
|
||||||
|
{
|
||||||
|
auto value = property(CSS::PropertyID::ObjectFit);
|
||||||
|
return value_id_to_object_fit(value->to_identifier());
|
||||||
|
}
|
||||||
|
|
||||||
Color StyleProperties::stop_color() const
|
Color StyleProperties::stop_color() const
|
||||||
{
|
{
|
||||||
auto value = property(CSS::PropertyID::StopColor);
|
auto value = property(CSS::PropertyID::StopColor);
|
||||||
|
|
|
@ -110,6 +110,7 @@ public:
|
||||||
Optional<CSS::BorderCollapse> border_collapse() const;
|
Optional<CSS::BorderCollapse> border_collapse() const;
|
||||||
Vector<Vector<String>> grid_template_areas() const;
|
Vector<Vector<String>> grid_template_areas() const;
|
||||||
String grid_area() const;
|
String grid_area() const;
|
||||||
|
Optional<CSS::ObjectFit> object_fit() const;
|
||||||
|
|
||||||
Vector<CSS::Transformation> transformations() const;
|
Vector<CSS::Transformation> transformations() const;
|
||||||
CSS::TransformOrigin transform_origin() const;
|
CSS::TransformOrigin transform_origin() const;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue