mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +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 {
|
||||
use properties::longhands::letter_spacing::computed_value::T;
|
||||
match self.gecko.mLetterSpacing.as_value() {
|
||||
CoordDataValue::Normal => T(None),
|
||||
CoordDataValue::Coord(coord) => T(Some(Au(coord))),
|
||||
_ => unreachable!("Unexpected computed value for letter-spacing"),
|
||||
}
|
||||
debug_assert!(
|
||||
matches!(self.gecko.mLetterSpacing.as_value(),
|
||||
CoordDataValue::Normal |
|
||||
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>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue