mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-24 11:11:51 +00:00
LibWeb/CSS: Don't allow negative values in border-radius
property
This commit is contained in:
parent
632fc73643
commit
18cccd7633
Notes:
github-actions[bot]
2025-03-14 15:09:00 +00:00
Author: https://github.com/tcl3
Commit: 18cccd7633
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3916
Reviewed-by: https://github.com/AtkinsSJ ✅
4 changed files with 53 additions and 0 deletions
|
@ -1659,6 +1659,10 @@ RefPtr<CSSStyleValue> Parser::parse_border_radius_shorthand_value(TokenStream<Co
|
|||
auto maybe_dimension = parse_length_percentage(tokens);
|
||||
if (!maybe_dimension.has_value())
|
||||
return nullptr;
|
||||
if (maybe_dimension->is_length() && !property_accepts_length(PropertyID::BorderRadius, maybe_dimension->length()))
|
||||
return nullptr;
|
||||
if (maybe_dimension->is_percentage() && !property_accepts_percentage(PropertyID::BorderRadius, maybe_dimension->percentage()))
|
||||
return nullptr;
|
||||
if (reading_vertical) {
|
||||
vertical_radii.append(maybe_dimension.release_value());
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue