mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:07:34 +00:00
LibWeb: Use new StyleValue parsing for background-repeat
This commit is contained in:
parent
a0ec05ef81
commit
8e34bdc123
1 changed files with 4 additions and 7 deletions
|
@ -4628,9 +4628,8 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_repeat_value(TokenSt
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
auto const& token = tokens.next_token();
|
auto maybe_x_value = TRY(parse_css_value_for_property(PropertyID::BackgroundRepeat, tokens));
|
||||||
auto maybe_x_value = TRY(parse_css_value(token));
|
if (!maybe_x_value)
|
||||||
if (!maybe_x_value || !property_accepts_value(PropertyID::BackgroundRepeat, *maybe_x_value))
|
|
||||||
return nullptr;
|
return nullptr;
|
||||||
auto x_value = maybe_x_value.release_nonnull();
|
auto x_value = maybe_x_value.release_nonnull();
|
||||||
|
|
||||||
|
@ -4647,14 +4646,12 @@ ErrorOr<RefPtr<StyleValue>> Parser::parse_single_background_repeat_value(TokenSt
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
||||||
// See if we have a second value for Y
|
// See if we have a second value for Y
|
||||||
auto const& second_token = tokens.peek_token();
|
auto maybe_y_value = TRY(parse_css_value_for_property(PropertyID::BackgroundRepeat, tokens));
|
||||||
auto maybe_y_value = TRY(parse_css_value(second_token));
|
if (!maybe_y_value) {
|
||||||
if (!maybe_y_value || !property_accepts_value(PropertyID::BackgroundRepeat, *maybe_y_value)) {
|
|
||||||
// We don't have a second value, so use x for both
|
// We don't have a second value, so use x for both
|
||||||
transaction.commit();
|
transaction.commit();
|
||||||
return BackgroundRepeatStyleValue::create(x_repeat.value(), x_repeat.value());
|
return BackgroundRepeatStyleValue::create(x_repeat.value(), x_repeat.value());
|
||||||
}
|
}
|
||||||
tokens.next_token();
|
|
||||||
auto y_value = maybe_y_value.release_nonnull();
|
auto y_value = maybe_y_value.release_nonnull();
|
||||||
if (is_directional_repeat(*y_value))
|
if (is_directional_repeat(*y_value))
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue