1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 22:37:35 +00:00

LibWeb: Add plumbing for the new 'object-position' property

Now, the 'object-position' property gets properly parsed and is
provided to the rest of the ecosystem.
In the parser we use the same parsing as for the background-position,
which is not entirely correct but almost a <position>.
This commit is contained in:
Tobias Christiansen 2023-10-16 13:52:51 +02:00 committed by Sam Atkins
parent 7e11de272f
commit d00c7e55a5
3 changed files with 14 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include <LibWeb/CSS/StyleValues/MathDepthStyleValue.h>
#include <LibWeb/CSS/StyleValues/NumberStyleValue.h>
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
#include <LibWeb/CSS/StyleValues/RectStyleValue.h>
#include <LibWeb/CSS/StyleValues/ShadowStyleValue.h>
#include <LibWeb/CSS/StyleValues/StringStyleValue.h>
@ -1007,6 +1008,12 @@ Optional<CSS::ObjectFit> StyleProperties::object_fit() const
return value_id_to_object_fit(value->to_identifier());
}
CSS::PositionStyleValue const& StyleProperties::object_position() const
{
auto value = property(CSS::PropertyID::ObjectPosition);
return value->as_position();
}
Optional<CSS::TableLayout> StyleProperties::table_layout() const
{
auto value = property(CSS::PropertyID::TableLayout);