Skip to content

Commit

Permalink
Auto merge of #15323 - Manishearth:gradient-stop, r=<try>
Browse files Browse the repository at this point in the history
Ensure that gradients have at least 2 stops

fixes https://bugzilla.mozilla.org/show_bug.cgi?id=1335656

r? @heycam
  • Loading branch information
bors-servo committed Feb 1, 2017
2 parents da89099 + c0e1a1f commit 9a89eb8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions components/style/values/specified/image.rs
Expand Up @@ -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,
Expand Down

0 comments on commit 9a89eb8

Please sign in to comment.