From cb157b568f2406647370f16b22f9ba6b8535a6b9 Mon Sep 17 00:00:00 2001 From: Manish Goregaokar Date: Sun, 9 Oct 2016 00:36:34 +0530 Subject: [PATCH] impl GeckoStyleCoordConvertible for Au --- components/style/gecko/values.rs | 13 +++++++++++++ components/style/properties/gecko.mako.rs | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/components/style/gecko/values.rs b/components/style/gecko/values.rs index 79cfcbb0beb..5260adbb10f 100644 --- a/components/style/gecko/values.rs +++ b/components/style/gecko/values.rs @@ -51,6 +51,19 @@ impl GeckoStyleCoordConvertible for LengthOrPercentage { } } +impl GeckoStyleCoordConvertible for Au { + fn to_gecko_style_coord(&self, coord: &mut T) { + coord.set_value(CoordDataValue::Coord(self.0)); + } + + fn from_gecko_style_coord(coord: &T) -> Option { + match coord.as_value() { + CoordDataValue::Coord(coord) => Some(Au(coord)), + _ => None, + } + } +} + impl GeckoStyleCoordConvertible for LengthOrPercentageOrAuto { fn to_gecko_style_coord(&self, coord: &mut T) { let value = match *self { diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 114d4fd964d..21b92289a32 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -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), } }