Handle calcs in ScrollSnapPoints conversions

This commit is contained in:
Manish Goregaokar 2017-08-24 13:56:50 -07:00
parent d4ddec8d33
commit 131949750f

View file

@ -414,10 +414,8 @@ impl GeckoStyleCoordConvertible for ScrollSnapPoint<LengthOrPercentage> {
Some( Some(
match coord.unit() { match coord.unit() {
nsStyleUnit::eStyleUnit_None => ScrollSnapPoint::None, nsStyleUnit::eStyleUnit_None => ScrollSnapPoint::None,
nsStyleUnit::eStyleUnit_Coord | nsStyleUnit::eStyleUnit_Percent => _ => ScrollSnapPoint::Repeat(LengthOrPercentage::from_gecko_style_coord(coord)
ScrollSnapPoint::Repeat(LengthOrPercentage::from_gecko_style_coord(coord) .expect("coord could not convert to LengthOrPercentage")),
.expect("coord could not convert to LengthOrPercentage")),
x => panic!("Unexpected unit {:?}", x)
} }
) )
} }