mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-19 15:43:20 +00:00
LibWeb: Support '<zero>' in '<color-stop-angle>`
`<color-stop-angle> = [ <angle-percentage> | <zero> ]{1,2}` but we were previously parsing instead as `<angle-percentage>{1,2}`.
This commit is contained in:
parent
cc2c8e8615
commit
cdbf4f49e1
Notes:
github-actions[bot]
2025-10-17 07:38:48 +00:00
Author: https://github.com/Calme1709
Commit: cdbf4f49e1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6497
Reviewed-by: https://github.com/tcl3 ✅
2 changed files with 15 additions and 5 deletions
|
@ -126,7 +126,18 @@ Optional<Vector<AngularColorStopListElement>> Parser::parse_angular_color_stop_l
|
|||
// <angular-color-stop> , [ <angular-color-hint>? , <angular-color-stop> ]#
|
||||
return parse_color_stop_list<AngularColorStopListElement>(
|
||||
tokens,
|
||||
[&](auto& it) { return parse_angle_percentage(it); });
|
||||
[&](TokenStream<ComponentValue>& it) -> Optional<AnglePercentage> {
|
||||
if (tokens.next_token().is(Token::Type::Number)) {
|
||||
auto transaction = tokens.begin_transaction();
|
||||
auto numeric_value = tokens.consume_a_token().token().number_value();
|
||||
if (numeric_value == 0) {
|
||||
transaction.commit();
|
||||
return Angle::make_degrees(0);
|
||||
}
|
||||
}
|
||||
|
||||
return parse_angle_percentage(it);
|
||||
});
|
||||
}
|
||||
|
||||
Optional<InterpolationMethod> Parser::parse_interpolation_method(TokenStream<ComponentValue>& tokens)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue