Auto merge of #13651 - Manishearth:au-togeckostyle, r=emilio

impl GeckoStyleCoordConvertible for Au

r? @heycam

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/13651)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-09 07:52:51 -05:00 committed by GitHub
commit 5955f4a754
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),
}
}