mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Auto merge of #17587 - canaltinova:webkit-gradient, r=nox
Fix color stop sorting in -webkit-gradient This was causing a reftest failure in gecko side(layout/reftests/webkit-gradient/webkit-gradient-linear-2.html). Basically, it was sorting exactly opposite if two color stops have the same percentage. --- - [X] `./mach build -d` does not report any errors - [X] `./mach test-tidy` does not report any errors <!-- 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/17587) <!-- Reviewable:end -->
This commit is contained in:
commit
4f0f2fb13e
1 changed files with 1 additions and 4 deletions
|
@ -502,10 +502,7 @@ impl Gradient {
|
||||||
(&GenericGradientItem::ColorStop(ref a), &GenericGradientItem::ColorStop(ref b)) => {
|
(&GenericGradientItem::ColorStop(ref a), &GenericGradientItem::ColorStop(ref b)) => {
|
||||||
match (&a.position, &b.position) {
|
match (&a.position, &b.position) {
|
||||||
(&Some(LengthOrPercentage::Percentage(a)), &Some(LengthOrPercentage::Percentage(b))) => {
|
(&Some(LengthOrPercentage::Percentage(a)), &Some(LengthOrPercentage::Percentage(b))) => {
|
||||||
let ordering = a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal);
|
return a.0.partial_cmp(&b.0).unwrap_or(Ordering::Equal);
|
||||||
if ordering != Ordering::Equal {
|
|
||||||
return ordering;
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
_ => {},
|
_ => {},
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue