mirror of
https://github.com/servo/servo.git
synced 2025-07-01 20:43:39 +01:00
Ensure that gradients have at least 2 stops
This commit is contained in:
parent
da89099e26
commit
c0e1a1f963
1 changed files with 5 additions and 0 deletions
|
@ -141,6 +141,11 @@ impl Gradient {
|
|||
_ => { return Err(()); }
|
||||
};
|
||||
|
||||
// https://drafts.csswg.org/css-images/#typedef-color-stop-list
|
||||
if stops.len() < 2 {
|
||||
return Err(())
|
||||
}
|
||||
|
||||
Ok(Gradient {
|
||||
stops: stops,
|
||||
repeating: repeating,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue