diff --git a/ports/geckolib/properties.mako.rs b/ports/geckolib/properties.mako.rs index 4622c9639be..55a9a528bbd 100644 --- a/ports/geckolib/properties.mako.rs +++ b/ports/geckolib/properties.mako.rs @@ -666,7 +666,7 @@ fn static_assert() { match v { % for value in keyword.values_for('gecko'): T::${to_rust_ident(value)} => - self.gecko.mVerticalAlign.set_int(structs::${keyword.gecko_constant(value)} as i32), + self.gecko.mVerticalAlign.set_enum(structs::${keyword.gecko_constant(value)} as i32), % endfor T::LengthOrPercentage(v) => self.gecko.mVerticalAlign.set(v), } diff --git a/ports/geckolib/values.rs b/ports/geckolib/values.rs index 7a313315f1f..c2d227970ee 100644 --- a/ports/geckolib/values.rs +++ b/ports/geckolib/values.rs @@ -13,6 +13,7 @@ pub trait StyleCoordHelpers { fn set_auto(&mut self); fn set_coord(&mut self, val: Au); fn set_int(&mut self, val: i32); + fn set_enum(&mut self, val: i32); fn set_percent(&mut self, val: f32); } @@ -40,6 +41,11 @@ impl StyleCoordHelpers for nsStyleCoord { self.mUnit = nsStyleUnit::eStyleUnit_Integer; unsafe { *self.mValue.mInt.as_mut() = val; } } + + fn set_enum(&mut self, val: i32) { + self.mUnit = nsStyleUnit::eStyleUnit_Enumerated; + unsafe { *self.mValue.mInt.as_mut() = val; } + } } pub trait ToGeckoStyleCoord {