mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
style: Don't simplify percentages that resolve to lengths in min/max/clamp
Those can't be ordered at specified / computed value time, since the percentage basis could be negative. Needs tests of course, running through try atm. Differential Revision: https://phabricator.services.mozilla.com/D115591
This commit is contained in:
parent
204cb7a9c0
commit
908c952ab0
2 changed files with 8 additions and 15 deletions
|
@ -107,8 +107,12 @@ impl PartialOrd for Leaf {
|
|||
}
|
||||
|
||||
match (self, other) {
|
||||
// NOTE: Percentages can't be compared reasonably here because the
|
||||
// percentage basis might be negative, see bug 1709018.
|
||||
// Conveniently, we only use this for <length-percentage> (for raw
|
||||
// percentages, we go through resolve()).
|
||||
(&Percentage(..), &Percentage(..)) => None,
|
||||
(&Length(ref one), &Length(ref other)) => one.partial_cmp(other),
|
||||
(&Percentage(ref one), &Percentage(ref other)) => one.partial_cmp(other),
|
||||
(&Angle(ref one), &Angle(ref other)) => one.degrees().partial_cmp(&other.degrees()),
|
||||
(&Time(ref one), &Time(ref other)) => one.seconds().partial_cmp(&other.seconds()),
|
||||
(&Number(ref one), &Number(ref other)) => one.partial_cmp(other),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue