mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 09:30:24 +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
Notes:
sideshowbarker
2024-07-17 04:49:48 +09:00
Author: https://github.com/TobyAsE Commit: https://github.com/SerenityOS/serenity/commit/5fc6bff582 Pull-request: https://github.com/SerenityOS/serenity/pull/20304 Reviewed-by: https://github.com/AtkinsSJ ✅ Reviewed-by: https://github.com/awesomekling Reviewed-by: https://github.com/trflynn89
6 changed files with 24 additions and 0 deletions
|
@ -106,6 +106,7 @@ public:
|
|||
static CSS::BorderCollapse border_collapse() { return CSS::BorderCollapse::Separate; }
|
||||
static Vector<Vector<String>> grid_template_areas() { return {}; }
|
||||
static CSS::Time transition_delay() { return CSS::Time::make_seconds(0); }
|
||||
static CSS::ObjectFit object_fit() { return CSS::ObjectFit::Fill; }
|
||||
};
|
||||
|
||||
enum class BackgroundSize {
|
||||
|
|
|
@ -238,6 +238,13 @@
|
|||
"inside",
|
||||
"outside"
|
||||
],
|
||||
"object-fit": [
|
||||
"fill",
|
||||
"contain",
|
||||
"cover",
|
||||
"none",
|
||||
"scale-down"
|
||||
],
|
||||
"overflow": [
|
||||
"auto",
|
||||
"clip",
|
||||
|
|
|
@ -131,6 +131,7 @@
|
|||
"fantasy",
|
||||
"fast",
|
||||
"fine",
|
||||
"fill",
|
||||
"fit-content",
|
||||
"fixed",
|
||||
"flex",
|
||||
|
@ -262,6 +263,7 @@
|
|||
"s-resize",
|
||||
"safe",
|
||||
"sans-serif",
|
||||
"scale-down",
|
||||
"scroll",
|
||||
"se-resize",
|
||||
"self-end",
|
||||
|
|
|
@ -1559,6 +1559,13 @@
|
|||
"unitless-length"
|
||||
]
|
||||
},
|
||||
"object-fit": {
|
||||
"inherited": false,
|
||||
"initial": "fill",
|
||||
"valid-types": [
|
||||
"object-fit"
|
||||
]
|
||||
},
|
||||
"opacity": {
|
||||
"affects-layout": false,
|
||||
"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();
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
auto value = property(CSS::PropertyID::StopColor);
|
||||
|
|
|
@ -110,6 +110,7 @@ public:
|
|||
Optional<CSS::BorderCollapse> border_collapse() const;
|
||||
Vector<Vector<String>> grid_template_areas() const;
|
||||
String grid_area() const;
|
||||
Optional<CSS::ObjectFit> object_fit() const;
|
||||
|
||||
Vector<CSS::Transformation> transformations() const;
|
||||
CSS::TransformOrigin transform_origin() const;
|
||||
|
|
Loading…
Reference in a new issue