LibWeb/CSS: Handle whitespace properly for border-image properties

This commit is contained in:
Sam Atkins 2025-10-28 15:58:14 +00:00
parent a2cd5d5ec8
commit c5fa5fb80e
Notes: github-actions[bot] 2025-11-03 11:29:04 +00:00
2 changed files with 5 additions and 6 deletions

View file

@ -1772,8 +1772,10 @@ RefPtr<StyleValue const> Parser::parse_border_image_slice_value(TokenStream<Comp
return false;
};
tokens.discard_whitespace();
if (parse_fill(tokens))
fill = true;
tokens.discard_whitespace();
Vector<ValueComparingNonnullRefPtr<StyleValue const>> number_percentages;
while (number_percentages.size() <= 4 && tokens.has_next_token()) {
@ -1786,6 +1788,7 @@ RefPtr<StyleValue const> Parser::parse_border_image_slice_value(TokenStream<Comp
if (number_percentage->is_percentage() && !property_accepts_percentage(PropertyID::BorderImageSlice, number_percentage->as_percentage().percentage()))
return nullptr;
number_percentages.append(number_percentage.release_nonnull());
tokens.discard_whitespace();
}
switch (number_percentages.size()) {
@ -1817,11 +1820,13 @@ RefPtr<StyleValue const> Parser::parse_border_image_slice_value(TokenStream<Comp
return nullptr;
}
tokens.discard_whitespace();
if (tokens.has_next_token() && parse_fill(tokens)) {
if (fill)
return nullptr;
fill = true;
tokens.discard_whitespace();
}
transaction.commit();