Skip to content

Commit

Permalink
Auto merge of #15323 - Manishearth:gradient-stop, r=heycam
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

<!-- 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 -->
  • Loading branch information
bors-servo committed Feb 1, 2017
2 parents 8066315 + c0e1a1f commit b7887a1
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 b7887a1

Please sign in to comment.