Fix color stop sorting in -webkit-gradient

This commit is contained in:
Nazım Can Altınova 2017-07-01 13:07:34 -07:00
parent d16ef3cd33
commit 26ad2a1331

View file

@ -433,10 +433,7 @@ impl Gradient {
(&GenericGradientItem::ColorStop(ref a), &GenericGradientItem::ColorStop(ref b)) => {
match (&a.position, &b.position) {
(&Some(LengthOrPercentage::Percentage(a)), &Some(LengthOrPercentage::Percentage(b))) => {
let ordering = a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal);
if ordering != Ordering::Equal {
return ordering;
}
return a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal);
},
_ => {},
}