mirror of
https://github.com/servo/servo.git
synced 2025-10-16 08:20:22 +01:00
style: Serialize NaN and infinity angles as per spec
`NaN`, `infinity`, and `-infinity` angles should be specially serialized. Also fixed a few relevant WPT tests which did not follow spec. (see https://github.com/web-platform-tests/wpt/pull/38825) Adjusted WPT test expectations, 40 newly pass 🎉 Differential Revision: https://phabricator.services.mozilla.com/D171658
This commit is contained in:
parent
7b28572309
commit
a8fef9d4f2
3 changed files with 66 additions and 16 deletions
|
@ -836,7 +836,12 @@ impl CalcNode {
|
|||
Leaf::Angle(ref angle) => Ok(angle.degrees()),
|
||||
_ => Err(()),
|
||||
})?;
|
||||
Ok(Angle::from_calc(crate::values::normalize(degrees)))
|
||||
let result = Angle::from_calc(if nan_inf_enabled() {
|
||||
degrees
|
||||
} else {
|
||||
crate::values::normalize(degrees)
|
||||
});
|
||||
Ok(result)
|
||||
}
|
||||
|
||||
/// Tries to simplify this expression into a `<number>` value.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue