Use from_gecko_style_coord() to convert CoordDataValue to Option<T> for letter-spacing.

This commit is contained in:
Hiroyuki Ikezoe 2017-04-07 10:59:53 +09:00
parent f1642eb7a6
commit 933a5d2f9c

View file

@ -2885,11 +2885,12 @@ fn static_assert() {
pub fn clone_letter_spacing(&self) -> longhands::letter_spacing::computed_value::T { pub fn clone_letter_spacing(&self) -> longhands::letter_spacing::computed_value::T {
use properties::longhands::letter_spacing::computed_value::T; use properties::longhands::letter_spacing::computed_value::T;
match self.gecko.mLetterSpacing.as_value() { debug_assert!(
CoordDataValue::Normal => T(None), matches!(self.gecko.mLetterSpacing.as_value(),
CoordDataValue::Coord(coord) => T(Some(Au(coord))), CoordDataValue::Normal |
_ => unreachable!("Unexpected computed value for letter-spacing"), CoordDataValue::Coord(_)),
} "Unexpected computed value for letter-spacing");
T(Au::from_gecko_style_coord(&self.gecko.mLetterSpacing))
} }
<%call expr="impl_coord_copy('letter_spacing', 'mLetterSpacing')"></%call> <%call expr="impl_coord_copy('letter_spacing', 'mLetterSpacing')"></%call>