mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 09:00:22 +00:00
LibWeb: Use new StyleValue parsing for background-size
This commit is contained in:
parent
8e34bdc123
commit
021fd15434
Notes:
sideshowbarker
2024-07-17 02:42:21 +09:00
Author: https://github.com/AtkinsSJ Commit: https://github.com/SerenityOS/serenity/commit/021fd15434 Pull-request: https://github.com/SerenityOS/serenity/pull/19028
1 changed files with 4 additions and 5 deletions
|
@ -4678,8 +4678,8 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_size_value(TokenStre
|
||||||
return {};
|
return {};
|
||||||
};
|
};
|
||||||
|
|
||||||
auto maybe_x_value = TRY(parse_css_value(tokens.next_token()));
|
auto maybe_x_value = TRY(parse_css_value_for_property(PropertyID::BackgroundSize, tokens));
|
||||||
if (!maybe_x_value || !property_accepts_value(PropertyID::BackgroundSize, *maybe_x_value))
|
if (!maybe_x_value)
|
||||||
return nullptr;
|
return nullptr;
|
||||||
auto x_value = maybe_x_value.release_nonnull();
|
auto x_value = maybe_x_value.release_nonnull();
|
||||||
|
|
||||||
|
@ -4688,8 +4688,8 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_size_value(TokenStre
|
||||||
return x_value;
|
return x_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
auto maybe_y_value = TRY(parse_css_value(tokens.peek_token()));
|
auto maybe_y_value = TRY(parse_css_value_for_property(PropertyID::BackgroundSize, tokens));
|
||||||
if (!maybe_y_value || !property_accepts_value(PropertyID::BackgroundSize, *maybe_y_value)) {
|
if (!maybe_y_value) {
|
||||||
auto y_value = LengthPercentage { Length::make_auto() };
|
auto y_value = LengthPercentage { Length::make_auto() };
|
||||||
auto x_size = get_length_percentage(*x_value);
|
auto x_size = get_length_percentage(*x_value);
|
||||||
if (!x_size.has_value())
|
if (!x_size.has_value())
|
||||||
|
@ -4698,7 +4698,6 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_size_value(TokenStre
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
return BackgroundSizeStyleValue::create(x_size.value(), y_value);
|
return BackgroundSizeStyleValue::create(x_size.value(), y_value);
|
||||||
}
|
}
|
||||||
tokens.next_token();
|
|
||||||
|
|
||||||
auto y_value = maybe_y_value.release_nonnull();
|
auto y_value = maybe_y_value.release_nonnull();
|
||||||
auto x_size = get_length_percentage(*x_value);
|
auto x_size = get_length_percentage(*x_value);
|
||||||
|
|
Loading…
Reference in a new issue