mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-25 19:04:58 +00:00
LibWeb: Parse and plumb background-position-x/y
This parses the new background-position-x/y longhands and properly hooks up them up. This requires converting PositionStyleValue to just contain two EdgeStyleValues so that it can be easily expanded into the longhands.
This commit is contained in:
@@ -43,6 +43,7 @@
|
||||
#include <LibWeb/CSS/StyleValues/NumericStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/OverflowStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PercentageStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/PositionStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/StyleValueList.h>
|
||||
#include <LibWeb/CSS/StyleValues/TextDecorationStyleValue.h>
|
||||
#include <LibWeb/CSS/StyleValues/UnresolvedStyleValue.h>
|
||||
@@ -454,6 +455,19 @@ static void set_property_expanding_shorthands(StyleProperties& style, CSS::Prope
|
||||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::BackgroundPosition) {
|
||||
if (value.is_position()) {
|
||||
auto const& position = value.as_position();
|
||||
style.set_property(CSS::PropertyID::BackgroundPositionX, position.edge_x());
|
||||
style.set_property(CSS::PropertyID::BackgroundPositionY, position.edge_y());
|
||||
return;
|
||||
}
|
||||
|
||||
style.set_property(CSS::PropertyID::BackgroundPositionX, value);
|
||||
style.set_property(CSS::PropertyID::BackgroundPositionY, value);
|
||||
return;
|
||||
}
|
||||
|
||||
if (property_id == CSS::PropertyID::Margin) {
|
||||
if (value.is_value_list()) {
|
||||
auto const& values_list = value.as_value_list();
|
||||
|
||||
Reference in New Issue
Block a user