mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +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
|
@ -15,7 +15,6 @@ use selectors::parser::SelectorParseErrorKind;
|
|||
#[cfg(feature = "servo")]
|
||||
use servo_url::ServoUrl;
|
||||
use std::cmp::Ordering;
|
||||
use std::f32::consts::PI;
|
||||
use std::fmt::{self, Write};
|
||||
use style_traits::{CssType, CssWriter, KeywordsCollectFn, ParseError};
|
||||
use style_traits::{StyleParseErrorKind, SpecifiedValueInfo, ToCss};
|
||||
|
@ -679,7 +678,7 @@ impl GradientKind {
|
|||
impl generic::LineDirection for LineDirection {
|
||||
fn points_downwards(&self, compat_mode: CompatMode) -> bool {
|
||||
match *self {
|
||||
LineDirection::Angle(ref angle) => angle.radians() == PI,
|
||||
LineDirection::Angle(ref angle) => angle.degrees() == 180.0,
|
||||
LineDirection::Vertical(Y::Bottom) if compat_mode == CompatMode::Modern => true,
|
||||
LineDirection::Vertical(Y::Top) if compat_mode != CompatMode::Modern => true,
|
||||
#[cfg(feature = "gecko")]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue