style: Make css(dimension) apply to the variant.

This commit is contained in:
Emilio Cobos Álvarez 2017-11-12 15:50:12 +01:00
parent 4927786d90
commit 92944cd5eb
No known key found for this signature in database
GPG key ID: 056B727BB9C1027C
8 changed files with 39 additions and 37 deletions

View file

@ -214,7 +214,7 @@ impl<L: GeckoStyleCoordConvertible> GeckoStyleCoordConvertible for TrackBreadth<
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
match *self {
TrackBreadth::Breadth(ref lop) => lop.to_gecko_style_coord(coord),
TrackBreadth::Flex(fr) => coord.set_value(CoordDataValue::FlexFraction(fr)),
TrackBreadth::Fr(fr) => coord.set_value(CoordDataValue::FlexFraction(fr)),
TrackBreadth::Keyword(TrackKeyword::Auto) => coord.set_value(CoordDataValue::Auto),
TrackBreadth::Keyword(TrackKeyword::MinContent) =>
coord.set_value(CoordDataValue::Enumerated(StyleGridTrackBreadth::MinContent as u32)),
@ -235,7 +235,7 @@ impl<L: GeckoStyleCoordConvertible> GeckoStyleCoordConvertible for TrackBreadth<
None
}
},
CoordDataValue::FlexFraction(fr) => Some(TrackBreadth::Flex(fr)),
CoordDataValue::FlexFraction(fr) => Some(TrackBreadth::Fr(fr)),
CoordDataValue::Auto => Some(TrackBreadth::Keyword(TrackKeyword::Auto)),
_ => L::from_gecko_style_coord(coord).map(TrackBreadth::Breadth),
}