Replace IntegerOrAuto with ZIndex

It's its only use.
This commit is contained in:
Anthony Ramine 2018-02-20 10:13:01 +01:00
parent 6a7ae3b12e
commit b44ffcf498
9 changed files with 75 additions and 50 deletions

View file

@ -262,7 +262,6 @@ class Longhand(object):
"ImageOrientation",
"InitialLetter",
"Integer",
"IntegerOrAuto",
"JustifyContent",
"JustifyItems",
"JustifySelf",
@ -283,6 +282,7 @@ class Longhand(object):
"TransformStyle",
"XSpan",
"XTextZoom",
"ZIndex",
}
return bool(self.keyword)

View file

@ -62,6 +62,7 @@ use values::computed::{NonNegativeLength, ToComputedValue, Percentage};
use values::computed::font::{FontSize, SingleFontFamily};
use values::computed::effects::{BoxShadow, Filter, SimpleShadow};
use values::computed::outline::OutlineStyle;
use values::generics::position::ZIndex;
use values::generics::transform::TransformStyle;
use computed_values::border_style;
@ -1750,8 +1751,8 @@ fn static_assert() {
pub fn set_z_index(&mut self, v: longhands::z_index::computed_value::T) {
match v {
Either::First(n) => self.gecko.mZIndex.set_value(CoordDataValue::Integer(n)),
Either::Second(Auto) => self.gecko.mZIndex.set_value(CoordDataValue::Auto),
ZIndex::Integer(n) => self.gecko.mZIndex.set_value(CoordDataValue::Integer(n)),
ZIndex::Auto => self.gecko.mZIndex.set_value(CoordDataValue::Auto),
}
}
@ -1771,11 +1772,11 @@ fn static_assert() {
pub fn clone_z_index(&self) -> longhands::z_index::computed_value::T {
return match self.gecko.mZIndex.as_value() {
CoordDataValue::Integer(n) => Either::First(n),
CoordDataValue::Auto => Either::Second(Auto),
CoordDataValue::Integer(n) => ZIndex::Integer(n),
CoordDataValue::Auto => ZIndex::Auto,
_ => {
debug_assert!(false);
Either::First(0)
ZIndex::Integer(0)
}
}
}

View file

@ -42,12 +42,14 @@ macro_rules! impl_align_conversions {
};
}
${helpers.predefined_type("z-index", "IntegerOrAuto",
"Either::Second(Auto)",
spec="https://www.w3.org/TR/CSS2/visuren.html#z-index",
flags="CREATES_STACKING_CONTEXT",
animation_value_type="ComputedValue")}
${helpers.predefined_type(
"z-index",
"ZIndex",
"computed::ZIndex::auto()",
spec="https://www.w3.org/TR/CSS2/visuren.html#z-index",
flags="CREATES_STACKING_CONTEXT",
animation_value_type="ComputedValue",
)}
// CSS Flexible Box Layout Module Level 1
// http://www.w3.org/TR/css3-flexbox/