Streamline parsing of NonNegativeLengthOrNumber a bit

This commit is contained in:
Anthony Ramine 2018-02-26 17:08:55 +01:00
parent f097dfad59
commit 4a98fa70bf
5 changed files with 20 additions and 31 deletions

View file

@ -4795,10 +4795,10 @@ fn static_assert() {
use values::Either;
match v {
Either::Second(non_negative_number) => {
Either::First(non_negative_number) => {
self.gecko.mTabSize.set_value(CoordDataValue::Factor(non_negative_number.0));
}
Either::First(non_negative_length) => {
Either::Second(non_negative_length) => {
self.gecko.mTabSize.set(non_negative_length);
}
}
@ -4809,8 +4809,8 @@ fn static_assert() {
use values::Either;
match self.gecko.mTabSize.as_value() {
CoordDataValue::Coord(coord) => Either::First(Au(coord).into()),
CoordDataValue::Factor(number) => Either::Second(From::from(number)),
CoordDataValue::Coord(coord) => Either::Second(Au(coord).into()),
CoordDataValue::Factor(number) => Either::First(From::from(number)),
_ => unreachable!(),
}
}