mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Specify eStyleUnit_Enumerated instead of eStyleUnit_Integer for enumerated types.
This commit is contained in:
parent
fe116b4bd7
commit
9b8ead8964
2 changed files with 7 additions and 1 deletions
|
@ -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),
|
||||
}
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue