impl GeckoStyleCoordConvertible for Au

This commit is contained in:
Manish Goregaokar 2016-10-09 00:36:34 +05:30
parent 9d3fc76463
commit cb157b568f
2 changed files with 14 additions and 1 deletions

View file

@ -51,6 +51,19 @@ impl GeckoStyleCoordConvertible for LengthOrPercentage {
}
}
impl GeckoStyleCoordConvertible for Au {
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
coord.set_value(CoordDataValue::Coord(self.0));
}
fn from_gecko_style_coord<T: CoordData>(coord: &T) -> Option<Self> {
match coord.as_value() {
CoordDataValue::Coord(coord) => Some(Au(coord)),
_ => None,
}
}
}
impl GeckoStyleCoordConvertible for LengthOrPercentageOrAuto {
fn to_gecko_style_coord<T: CoordDataMut>(&self, coord: &mut T) {
let value = match *self {

View file

@ -1837,7 +1837,7 @@ clip-path
pub fn set_column_width(&mut self, v: longhands::column_width::computed_value::T) {
match v.0 {
Some(au) => self.gecko.mColumnWidth.set_value(CoordDataValue::Coord(au.0)),
Some(au) => self.gecko.mColumnWidth.set(au),
None => self.gecko.mColumnWidth.set_value(CoordDataValue::Auto),
}
}