mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
style: Always compute angle values to degrees.
This matches the spec, https://drafts.csswg.org/css-values/#angles, which says: > All <angle> units are compatible, and deg is their canonical unit. And https://drafts.csswg.org/css-values/#compat, which says: >When serializing computed values [...], compatible units [...] are converted into a single canonical unit. And also other implementations (Blink always serializes angles as degrees in computed style for example). Also allows us to get rid of quite a bit of code, and makes computed angle value representation just a number, which is nice. Differential Revision: https://phabricator.services.mozilla.com/D8619
This commit is contained in:
parent
11fedf18d9
commit
42def5a011
11 changed files with 142 additions and 209 deletions
|
@ -325,10 +325,7 @@ impl GeckoStyleCoordConvertible for Angle {
|
|||
|
||||
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
|
||||
match coord.as_value() {
|
||||
CoordDataValue::Degree(val) => Some(Angle::Deg(val)),
|
||||
CoordDataValue::Grad(val) => Some(Angle::Grad(val)),
|
||||
CoordDataValue::Radian(val) => Some(Angle::Rad(val)),
|
||||
CoordDataValue::Turn(val) => Some(Angle::Turn(val)),
|
||||
CoordDataValue::Degree(val) => Some(Angle::from_degrees(val)),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue