mirror of
https://github.com/servo/servo.git
synced 2025-07-03 05:23:38 +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(()); }
|
_ => { return Err(()); }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// https://drafts.csswg.org/css-images/#typedef-color-stop-list
|
||||||
|
if stops.len() < 2 {
|
||||||
|
return Err(())
|
||||||
|
}
|
||||||
|
|
||||||
Ok(Gradient {
|
Ok(Gradient {
|
||||||
stops: stops,
|
stops: stops,
|
||||||
repeating: repeating,
|
repeating: repeating,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue