1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:18:11 +00:00

LibWeb: Create EdgeStyleValue for BackgroundPositionXY with no offset

When specifying either `background-position-x: right` or
`background-position-y: bottom` without an offset value no
EdgeStyleValue was created.

However, the spec says the offset should be optional.

Now, if you do not provide an offset, it creates the EdgeStyleValue
with a default offset of 0 pixels.
This commit is contained in:
Alan Kemp 2023-07-09 22:49:45 +01:00 committed by Sam Atkins
parent 016b31fae2
commit 3fd870a429
4 changed files with 28 additions and 1 deletions

View file

@ -4783,7 +4783,9 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_position_x_or_y_valu
return EdgeStyleValue::create(relative_edge, *offset);
}
return nullptr;
// If no offset is provided create this element but with an offset of default value of zero
transaction.commit();
return EdgeStyleValue::create(relative_edge, Length::make_px(0));
}
ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_repeat_value(TokenStream<ComponentValue>& tokens)