diff options
author | Anthony Ramine <n.oxyde@gmail.com> | 2017-06-01 11:06:51 +0200 |
---|---|---|
committer | Anthony Ramine <n.oxyde@gmail.com> | 2017-06-02 10:53:28 +0200 |
commit | e58f5419510f01ba9f291eb95eb2ac4b4cc4e6a4 (patch) | |
tree | 598bdf69738d2b6b74ba6a63800656cb32f183c5 | |
parent | 7da94d08802c20b3a31ca2d792e30c9f57958853 (diff) | |
download | servo-e58f5419510f01ba9f291eb95eb2ac4b4cc4e6a4.tar.gz servo-e58f5419510f01ba9f291eb95eb2ac4b4cc4e6a4.zip |
Rename BorderImageWidthSide to BorderImageSideWidth
-rw-r--r-- | components/style/properties/gecko.mako.rs | 8 | ||||
-rw-r--r-- | components/style/properties/longhand/border.mako.rs | 4 | ||||
-rw-r--r-- | components/style/values/computed/border.rs | 10 | ||||
-rw-r--r-- | components/style/values/computed/mod.rs | 2 | ||||
-rw-r--r-- | components/style/values/generics/border.rs | 10 | ||||
-rw-r--r-- | components/style/values/specified/border.rs | 18 | ||||
-rw-r--r-- | components/style/values/specified/mod.rs | 2 |
7 files changed, 27 insertions, 27 deletions
diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index c7d8e879848..c041e23c049 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -998,17 +998,17 @@ fn static_assert() { } pub fn set_border_image_width(&mut self, v: longhands::border_image_width::computed_value::T) { - use values::generics::border::BorderImageWidthSide; + use values::generics::border::BorderImageSideWidth; % for side in SIDES: match v.${side.index} { - BorderImageWidthSide::Auto => { + BorderImageSideWidth::Auto => { self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Auto) }, - BorderImageWidthSide::Length(l) => { + BorderImageSideWidth::Length(l) => { l.to_gecko_style_coord(&mut self.gecko.mBorderImageWidth.data_at_mut(${side.index})) }, - BorderImageWidthSide::Number(n) => { + BorderImageSideWidth::Number(n) => { self.gecko.mBorderImageWidth.data_at_mut(${side.index}).set_value(CoordDataValue::Factor(n)) }, } diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 40aaffdc716..f2eae0dfe42 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -289,8 +289,8 @@ ${helpers.predefined_type("border-image-outset", "LengthOrNumberRect", </%helpers:longhand> ${helpers.predefined_type("border-image-width", "BorderImageWidth", - initial_value="computed::BorderImageWidthSide::one().into()", - initial_specified_value="specified::BorderImageWidthSide::one().into()", + initial_value="computed::BorderImageSideWidth::one().into()", + initial_specified_value="specified::BorderImageSideWidth::one().into()", spec="https://drafts.csswg.org/css-backgrounds/#border-image-width", animation_value_type="none", boxed=True)} diff --git a/components/style/values/computed/border.rs b/components/style/values/computed/border.rs index 00408b302eb..e4073601c10 100644 --- a/components/style/values/computed/border.rs +++ b/components/style/values/computed/border.rs @@ -7,16 +7,16 @@ use values::computed::{Number, NumberOrPercentage}; use values::computed::length::LengthOrPercentage; use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius; +use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth; use values::generics::border::BorderImageSlice as GenericBorderImageSlice; -use values::generics::border::BorderImageWidthSide as GenericBorderImageWidthSide; use values::generics::border::BorderRadius as GenericBorderRadius; use values::generics::rect::Rect; /// A computed value for the `border-image-width` property. -pub type BorderImageWidth = Rect<BorderImageWidthSide>; +pub type BorderImageWidth = Rect<BorderImageSideWidth>; /// A computed value for a single side of a `border-image-width` property. -pub type BorderImageWidthSide = GenericBorderImageWidthSide<LengthOrPercentage, Number>; +pub type BorderImageSideWidth = GenericBorderImageSideWidth<LengthOrPercentage, Number>; /// A computed value for the `border-image-slice` property. pub type BorderImageSlice = GenericBorderImageSlice<NumberOrPercentage>; @@ -27,10 +27,10 @@ pub type BorderRadius = GenericBorderRadius<LengthOrPercentage>; /// A computed value for the `border-*-radius` longhand properties. pub type BorderCornerRadius = GenericBorderCornerRadius<LengthOrPercentage>; -impl BorderImageWidthSide { +impl BorderImageSideWidth { /// Returns `1`. #[inline] pub fn one() -> Self { - GenericBorderImageWidthSide::Number(1.) + GenericBorderImageSideWidth::Number(1.) } } diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index d18d43defbc..039c3763567 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -24,7 +24,7 @@ use super::specified; pub use app_units::Au; pub use cssparser::Color as CSSColor; pub use self::background::BackgroundSize; -pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageWidthSide}; +pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageSideWidth}; pub use self::border::{BorderRadius, BorderCornerRadius}; pub use self::image::{Gradient, GradientItem, ImageLayer, LineDirection, Image, ImageRect}; pub use self::rect::LengthOrNumberRect; diff --git a/components/style/values/generics/border.rs b/components/style/values/generics/border.rs index 6bfc5234b3d..f1384e580e3 100644 --- a/components/style/values/generics/border.rs +++ b/components/style/values/generics/border.rs @@ -12,7 +12,7 @@ use values::generics::rect::Rect; /// A generic value for a single side of a `border-image-width` property. #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[derive(Clone, Copy, Debug, HasViewportPercentage, PartialEq, ToComputedValue)] -pub enum BorderImageWidthSide<LengthOrPercentage, Number> { +pub enum BorderImageSideWidth<LengthOrPercentage, Number> { /// `<length-or-percentage>` Length(LengthOrPercentage), /// `<number>` @@ -52,16 +52,16 @@ pub struct BorderRadius<LengthOrPercentage> { /// A generic value for `border-*-radius` longhand properties. pub struct BorderCornerRadius<L>(pub Size2D<L>); -impl<L, N> ToCss for BorderImageWidthSide<L, N> +impl<L, N> ToCss for BorderImageSideWidth<L, N> where L: ToCss, N: ToCss, { fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { match *self { - BorderImageWidthSide::Length(ref length) => length.to_css(dest), - BorderImageWidthSide::Number(ref number) => number.to_css(dest), - BorderImageWidthSide::Auto => dest.write_str("auto"), + BorderImageSideWidth::Length(ref length) => length.to_css(dest), + BorderImageSideWidth::Number(ref number) => number.to_css(dest), + BorderImageSideWidth::Auto => dest.write_str("auto"), } } } diff --git a/components/style/values/specified/border.rs b/components/style/values/specified/border.rs index 741b6a1d94f..b931ef36245 100644 --- a/components/style/values/specified/border.rs +++ b/components/style/values/specified/border.rs @@ -11,8 +11,8 @@ use std::fmt; use style_traits::ToCss; use values::computed::{Context, ToComputedValue}; use values::generics::border::BorderCornerRadius as GenericBorderCornerRadius; +use values::generics::border::BorderImageSideWidth as GenericBorderImageSideWidth; use values::generics::border::BorderImageSlice as GenericBorderImageSlice; -use values::generics::border::BorderImageWidthSide as GenericBorderImageWidthSide; use values::generics::border::BorderRadius as GenericBorderRadius; use values::generics::rect::Rect; use values::specified::{AllowQuirks, Number, NumberOrPercentage}; @@ -33,10 +33,10 @@ pub enum BorderSideWidth { } /// A specified value for the `border-image-width` property. -pub type BorderImageWidth = Rect<BorderImageWidthSide>; +pub type BorderImageWidth = Rect<BorderImageSideWidth>; /// A specified value for a single side of a `border-image-width` property. -pub type BorderImageWidthSide = GenericBorderImageWidthSide<LengthOrPercentage, Number>; +pub type BorderImageSideWidth = GenericBorderImageSideWidth<LengthOrPercentage, Number>; /// A specified value for the `border-image-slice` property. pub type BorderImageSlice = GenericBorderImageSlice<NumberOrPercentage>; @@ -106,26 +106,26 @@ impl ToComputedValue for BorderSideWidth { } } -impl BorderImageWidthSide { +impl BorderImageSideWidth { /// Returns `1`. #[inline] pub fn one() -> Self { - GenericBorderImageWidthSide::Number(Number::new(1.)) + GenericBorderImageSideWidth::Number(Number::new(1.)) } } -impl Parse for BorderImageWidthSide { +impl Parse for BorderImageSideWidth { fn parse(context: &ParserContext, input: &mut Parser) -> Result<Self, ()> { if input.try(|i| i.expect_ident_matching("auto")).is_ok() { - return Ok(GenericBorderImageWidthSide::Auto); + return Ok(GenericBorderImageSideWidth::Auto); } if let Ok(len) = input.try(|i| LengthOrPercentage::parse_non_negative(context, i)) { - return Ok(GenericBorderImageWidthSide::Length(len)); + return Ok(GenericBorderImageSideWidth::Length(len)); } let num = Number::parse_non_negative(context, input)?; - Ok(GenericBorderImageWidthSide::Number(num)) + Ok(GenericBorderImageSideWidth::Number(num)) } } diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 893cbc4db4e..cc8855b15de 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -31,7 +31,7 @@ use values::specified::calc::CalcNode; pub use self::align::{AlignItems, AlignJustifyContent, AlignJustifySelf, JustifyItems}; pub use self::background::BackgroundSize; pub use self::border::{BorderCornerRadius, BorderImageSlice, BorderImageWidth}; -pub use self::border::{BorderImageWidthSide, BorderRadius, BorderSideWidth}; +pub use self::border::{BorderImageSideWidth, BorderRadius, BorderSideWidth}; pub use self::color::Color; pub use self::rect::LengthOrNumberRect; pub use super::generics::grid::GridLine; |