mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #15323 - Manishearth:gradient-stop, r=heycam
Ensure that gradients have at least 2 stops fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1335656 r? @heycam <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15323) <!-- Reviewable:end -->
This commit is contained in:
commit
b7887a1980
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