mirror of
https://github.com/servo/servo.git
synced 2025-08-06 22:15:33 +01:00
Use from_gecko_style_coord() to convert CoordDataValue to Option<T> for letter-spacing.
This commit is contained in:
parent
f1642eb7a6
commit
933a5d2f9c
1 changed files with 6 additions and 5 deletions
|
@ -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>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue