Don't use define_css_keyword_enum in style anymore

This commit is contained in:
Anthony Ramine 2018-01-30 13:52:11 +01:00
parent 09e304adb3
commit 3d99a4489c
14 changed files with 174 additions and 158 deletions

View file

@ -30,13 +30,16 @@ pub enum GeometryBox {
pub type FloatAreaShape<BasicShape, Image> = ShapeSource<BasicShape, ShapeBox, Image>;
// https://drafts.csswg.org/css-shapes-1/#typedef-shape-box
define_css_keyword_enum!(ShapeBox:
"margin-box" => MarginBox,
"border-box" => BorderBox,
"padding-box" => PaddingBox,
"content-box" => ContentBox
);
add_impls_for_keyword_enum!(ShapeBox);
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq)]
#[derive(ToComputedValue, ToCss)]
pub enum ShapeBox {
MarginBox,
BorderBox,
PaddingBox,
ContentBox,
}
/// A shape source, for some reference box.
#[allow(missing_docs)]
@ -117,11 +120,14 @@ pub struct Polygon<LengthOrPercentage> {
// NOTE: Basic shapes spec says that these are the only two values, however
// https://www.w3.org/TR/SVG/painting.html#FillRuleProperty
// says that it can also be `inherit`
define_css_keyword_enum!(FillRule:
"nonzero" => Nonzero,
"evenodd" => Evenodd
);
add_impls_for_keyword_enum!(FillRule);
#[allow(missing_docs)]
#[cfg_attr(feature = "servo", derive(Deserialize, Serialize))]
#[derive(Clone, Copy, Debug, Eq, MallocSizeOf, Parse, PartialEq)]
#[derive(ToComputedValue, ToCss)]
pub enum FillRule {
Nonzero,
Evenodd,
}
// FIXME(nox): Implement ComputeSquaredDistance for T types and stop
// using PartialEq here, this will let us derive this impl.