diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index 6b42c1e04bf..43c8ce3b3a3 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -439,13 +439,13 @@ pub mod basic_shape { fn from(reference: GeometryBox) -> Self { use gecko_bindings::structs::StyleGeometryBox::*; match reference { - GeometryBox::ShapeBox(ShapeBox::Content) => Content, - GeometryBox::ShapeBox(ShapeBox::Padding) => Padding, - GeometryBox::ShapeBox(ShapeBox::Border) => Border, - GeometryBox::ShapeBox(ShapeBox::Margin) => Margin, - GeometryBox::Fill => Fill, - GeometryBox::Stroke => Stroke, - GeometryBox::View => View, + GeometryBox::ShapeBox(ShapeBox::ContentBox) => ContentBox, + GeometryBox::ShapeBox(ShapeBox::PaddingBox) => PaddingBox, + GeometryBox::ShapeBox(ShapeBox::BorderBox) => BorderBox, + GeometryBox::ShapeBox(ShapeBox::MarginBox) => MarginBox, + GeometryBox::FillBox => FillBox, + GeometryBox::StrokeBox => StrokeBox, + GeometryBox::ViewBox => ViewBox, } } } @@ -457,13 +457,13 @@ pub mod basic_shape { fn from(reference: StyleGeometryBox) -> Self { use gecko_bindings::structs::StyleGeometryBox::*; match reference { - Content => GeometryBox::ShapeBox(ShapeBox::Content), - Padding => GeometryBox::ShapeBox(ShapeBox::Padding), - Border => GeometryBox::ShapeBox(ShapeBox::Border), - Margin => GeometryBox::ShapeBox(ShapeBox::Margin), - Fill => GeometryBox::Fill, - Stroke => GeometryBox::Stroke, - View => GeometryBox::View, + ContentBox => GeometryBox::ShapeBox(ShapeBox::ContentBox), + PaddingBox => GeometryBox::ShapeBox(ShapeBox::PaddingBox), + BorderBox => GeometryBox::ShapeBox(ShapeBox::BorderBox), + MarginBox => GeometryBox::ShapeBox(ShapeBox::MarginBox), + FillBox => GeometryBox::FillBox, + StrokeBox => GeometryBox::StrokeBox, + ViewBox => GeometryBox::ViewBox, other => panic!("Unexpected StyleGeometryBox::{:?} while converting to GeometryBox", other), } } diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index bce244dbd75..856582e924d 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -2000,13 +2000,13 @@ fn static_assert() { use properties::longhands::${shorthand}_clip::single_value::computed_value::T; match servo { - T::border_box => StyleGeometryBox::Border, - T::padding_box => StyleGeometryBox::Padding, - T::content_box => StyleGeometryBox::Content, + T::border_box => StyleGeometryBox::BorderBox, + T::padding_box => StyleGeometryBox::PaddingBox, + T::content_box => StyleGeometryBox::ContentBox, % if shorthand == "mask": - T::fill_box => StyleGeometryBox::Fill, - T::stroke_box => StyleGeometryBox::Stroke, - T::view_box => StyleGeometryBox::View, + T::fill_box => StyleGeometryBox::FillBox, + T::stroke_box => StyleGeometryBox::StrokeBox, + T::view_box => StyleGeometryBox::ViewBox, T::no_clip => StyleGeometryBox::NoClip, % elif shorthand == "background": T::text => StyleGeometryBox::Text, @@ -2019,13 +2019,13 @@ fn static_assert() { use properties::longhands::${shorthand}_origin::single_value::computed_value::T; match servo { - T::border_box => StyleGeometryBox::Border, - T::padding_box => StyleGeometryBox::Padding, - T::content_box => StyleGeometryBox::Content, + T::border_box => StyleGeometryBox::BorderBox, + T::padding_box => StyleGeometryBox::PaddingBox, + T::content_box => StyleGeometryBox::ContentBox, % if shorthand == "mask": - T::fill_box => StyleGeometryBox::Fill, - T::stroke_box => StyleGeometryBox::Stroke, - T::view_box => StyleGeometryBox::View, + T::fill_box => StyleGeometryBox::FillBox, + T::stroke_box => StyleGeometryBox::StrokeBox, + T::view_box => StyleGeometryBox::ViewBox, % endif } diff --git a/components/style/values/specified/basic_shape.rs b/components/style/values/specified/basic_shape.rs index 45815eb7cc7..469614a2b9f 100644 --- a/components/style/values/specified/basic_shape.rs +++ b/components/style/values/specified/basic_shape.rs @@ -859,9 +859,9 @@ impl ToCss for FillRule { #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum GeometryBox { - Fill, - Stroke, - View, + FillBox, + StrokeBox, + ViewBox, ShapeBox(ShapeBox), } @@ -871,9 +871,9 @@ impl Parse for GeometryBox { Ok(GeometryBox::ShapeBox(shape_box)) } else { match_ignore_ascii_case! { &try!(input.expect_ident()), - "fill-box" => Ok(GeometryBox::Fill), - "stroke-box" => Ok(GeometryBox::Stroke), - "view-box" => Ok(GeometryBox::View), + "fill-box" => Ok(GeometryBox::FillBox), + "stroke-box" => Ok(GeometryBox::StrokeBox), + "view-box" => Ok(GeometryBox::ViewBox), _ => Err(()) } } @@ -883,9 +883,9 @@ impl Parse for GeometryBox { impl ToCss for GeometryBox { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { - GeometryBox::Fill => dest.write_str("fill-box"), - GeometryBox::Stroke => dest.write_str("stroke-box"), - GeometryBox::View => dest.write_str("view-box"), + GeometryBox::FillBox => dest.write_str("fill-box"), + GeometryBox::StrokeBox => dest.write_str("stroke-box"), + GeometryBox::ViewBox => dest.write_str("view-box"), GeometryBox::ShapeBox(s) => s.to_css(dest), } } @@ -898,20 +898,20 @@ impl ComputedValueAsSpecified for GeometryBox {} #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] pub enum ShapeBox { - Margin, + MarginBox, // https://drafts.csswg.org/css-backgrounds-3/#box - Border, - Padding, - Content, + BorderBox, + PaddingBox, + ContentBox, } impl Parse for ShapeBox { fn parse(_context: &ParserContext, input: &mut Parser) -> Result { match_ignore_ascii_case! { &try!(input.expect_ident()), - "margin-box" => Ok(ShapeBox::Margin), - "border-box" => Ok(ShapeBox::Border), - "padding-box" => Ok(ShapeBox::Padding), - "content-box" => Ok(ShapeBox::Content), + "margin-box" => Ok(ShapeBox::MarginBox), + "border-box" => Ok(ShapeBox::BorderBox), + "padding-box" => Ok(ShapeBox::PaddingBox), + "content-box" => Ok(ShapeBox::ContentBox), _ => Err(()) } } @@ -920,10 +920,10 @@ impl Parse for ShapeBox { impl ToCss for ShapeBox { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { - ShapeBox::Margin => dest.write_str("margin-box"), - ShapeBox::Border => dest.write_str("border-box"), - ShapeBox::Padding => dest.write_str("padding-box"), - ShapeBox::Content => dest.write_str("content-box"), + ShapeBox::MarginBox => dest.write_str("margin-box"), + ShapeBox::BorderBox => dest.write_str("border-box"), + ShapeBox::PaddingBox => dest.write_str("padding-box"), + ShapeBox::ContentBox => dest.write_str("content-box"), } } }