author | Manish Goregaokar <manishsmail@gmail.com> |
Mon, 24 Jul 2017 17:26:31 -0700 | |
changeset 370696 | 131e19a573e901fb4d01b471b11b7916420b9fee |
parent 370695 | a2058025fd776f8e4ec889ab8ba1c217dc390e4f |
child 370820 | 80394cbcae0f02da8eb801edd92e56f974e5db4f |
push id | 92930 |
push user | cbook@mozilla.com |
push date | Tue, 25 Jul 2017 12:48:36 +0000 |
treeherder | mozilla-inbound@4b4a6f82e3e8 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | upsuper, tomcat |
milestone | 56.0a1 |
first release with | nightly linux32
131e19a573e9
/
56.0a1
/
20170725100346
/
files
nightly linux64
131e19a573e9
/
56.0a1
/
20170725100346
/
files
nightly mac
131e19a573e9
/
56.0a1
/
20170725100255
/
files
nightly win32
131e19a573e9
/
56.0a1
/
20170725030209
/
files
nightly win64
131e19a573e9
/
56.0a1
/
20170725030209
/
files
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
releases | nightly linux32
56.0a1
/
20170725100346
/
pushlog to previous
nightly linux64
56.0a1
/
20170725100346
/
pushlog to previous
nightly mac
56.0a1
/
20170725100255
/
pushlog to previous
nightly win32
56.0a1
/
20170725030209
/
pushlog to previous
nightly win64
56.0a1
/
20170725030209
/
pushlog to previous
|
servo/components/style/properties/gecko.mako.rs | file | annotate | diff | comparison | revisions | |
servo/components/style/properties/longhand/font.mako.rs | file | annotate | diff | comparison | revisions |
--- a/servo/components/style/properties/gecko.mako.rs +++ b/servo/components/style/properties/gecko.mako.rs @@ -2017,20 +2017,18 @@ fn static_assert() { } pub fn set_font_weight(&mut self, v: longhands::font_weight::computed_value::T) { self.gecko.mFont.weight = v.0; } ${impl_simple_copy('font_weight', 'mFont.weight')} pub fn clone_font_weight(&self) -> longhands::font_weight::computed_value::T { - debug_assert!(self.gecko.mFont.weight >= 100); - debug_assert!(self.gecko.mFont.weight <= 900); - debug_assert!(self.gecko.mFont.weight % 10 == 0); - unsafe { transmute(self.gecko.mFont.weight) } + debug_assert!(self.gecko.mFont.weight <= ::std::u16::MAX); + longhands::font_weight::computed_value::T(self.gecko.mFont.weight) } ${impl_simple_type_with_conversion("font_synthesis", "mFont.synthesis")} pub fn set_font_size_adjust(&mut self, v: longhands::font_size_adjust::computed_value::T) { use properties::longhands::font_size_adjust::computed_value::T; match v { T::None => self.gecko.mFont.sizeAdjust = -1.0 as f32,
--- a/servo/components/style/properties/longhand/font.mako.rs +++ b/servo/components/style/properties/longhand/font.mako.rs @@ -452,16 +452,19 @@ macro_rules! impl_gecko_keyword_conversi None } } } pub mod computed_value { /// As of CSS Fonts Module Level 3, only the following values are /// valid: 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 + /// + /// However, system fonts may provide other values. Pango + /// may provide 350, 380, and 1000 (on top of the existing values), for example. #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, ToCss)] #[cfg_attr(feature = "servo", derive(HeapSizeOf, Deserialize, Serialize))] pub struct T(pub u16); impl T { /// Value for normal pub fn normal() -> Self { T(400) @@ -478,18 +481,19 @@ macro_rules! impl_gecko_keyword_conversi Ok(T(n as u16)) } else { Err(()) } } /// Convert from an Gecko weight pub fn from_gecko_weight(weight: u16) -> Self { - Self::from_int(weight as i32) - .expect("from_gecko_weight: called with invalid weight") + // we allow a wider range of weights than is parseable + // because system fonts may provide custom values + T(weight) } /// Weither this weight is bold pub fn is_bold(&self) -> bool { self.0 > 500 } /// Return the bolder weight