From 907d629ca45b4ee1dfbeae0f4e2fded8feb67b91 Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Wed, 12 Jul 2017 10:11:28 +0200 Subject: [PATCH] Rename ImageRect to MozImageRect --- components/style/gecko/conversions.rs | 4 ++-- components/style/values/computed/image.rs | 8 ++++---- components/style/values/computed/mod.rs | 2 +- components/style/values/generics/image.rs | 8 ++++---- components/style/values/specified/image.rs | 12 ++++++------ components/style/values/specified/mod.rs | 2 +- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/components/style/gecko/conversions.rs b/components/style/gecko/conversions.rs index bc3dd20d6cb..d29f3a0979d 100644 --- a/components/style/gecko/conversions.rs +++ b/components/style/gecko/conversions.rs @@ -370,7 +370,7 @@ impl nsStyleImage { pub unsafe fn into_image(self: &nsStyleImage) -> Option { use gecko_bindings::bindings::Gecko_GetImageElement; use gecko_bindings::structs::nsStyleImageType; - use values::computed::{NumberOrPercentage, ImageRect}; + use values::computed::{NumberOrPercentage, MozImageRect}; match self.mType { nsStyleImageType::eStyleImageType_Null => { @@ -387,7 +387,7 @@ impl nsStyleImage { NumberOrPercentage::from_gecko_style_coord(&rect.data_at(2)), NumberOrPercentage::from_gecko_style_coord(&rect.data_at(3))) { (Some(top), Some(right), Some(bottom), Some(left)) => - Some(GenericImage::Rect(ImageRect { url, top, right, bottom, left } )), + Some(GenericImage::Rect(MozImageRect { url, top, right, bottom, left } )), _ => { debug_assert!(false, "mCropRect could not convert to NumberOrPercentage"); None diff --git a/components/style/values/computed/image.rs b/components/style/values/computed/image.rs index 1e2b694d51d..2037640ef64 100644 --- a/components/style/values/computed/image.rs +++ b/components/style/values/computed/image.rs @@ -17,7 +17,7 @@ use values::computed::position::Position; use values::generics::image::{CompatMode, ColorStop as GenericColorStop, EndingShape as GenericEndingShape}; use values::generics::image::{Gradient as GenericGradient, GradientItem as GenericGradientItem}; use values::generics::image::{Image as GenericImage, GradientKind as GenericGradientKind}; -use values::generics::image::{ImageRect as GenericImageRect, LineDirection as GenericLineDirection}; +use values::generics::image::{LineDirection as GenericLineDirection, MozImageRect as GenericMozImageRect}; use values::specified::image::{Gradient as SpecifiedGradient, LineDirection as SpecifiedLineDirection}; use values::specified::image::{GradientKind as SpecifiedGradientKind}; use values::specified::position::{X, Y}; @@ -27,7 +27,7 @@ pub type ImageLayer = Either; /// Computed values for an image according to CSS-IMAGES. /// https://drafts.csswg.org/css-images/#image-values -pub type Image = GenericImage; +pub type Image = GenericImage; /// Computed values for a CSS gradient. /// https://drafts.csswg.org/css-images/#gradients @@ -71,8 +71,8 @@ pub type GradientItem = GenericGradientItem; /// A computed color stop. pub type ColorStop = GenericColorStop; -/// Computed values for ImageRect. -pub type ImageRect = GenericImageRect; +/// Computed values for `-moz-image-rect(...)`. +pub type MozImageRect = GenericMozImageRect; impl GenericLineDirection for LineDirection { fn points_downwards(&self) -> bool { diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 9b08cd6e2bb..db63c87cbb1 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -30,7 +30,7 @@ pub use self::border::{BorderRadius, BorderCornerRadius}; pub use self::color::{Color, RGBAColor}; pub use self::effects::{BoxShadow, Filter, SimpleShadow}; pub use self::flex::FlexBasis; -pub use self::image::{Gradient, GradientItem, ImageLayer, LineDirection, Image, ImageRect}; +pub use self::image::{Gradient, GradientItem, Image, ImageLayer, LineDirection, MozImageRect}; #[cfg(feature = "gecko")] pub use self::gecko::ScrollSnapPoint; pub use self::rect::LengthOrNumberRect; diff --git a/components/style/values/generics/image.rs b/components/style/values/generics/image.rs index 78d011beac0..25b5b96aebb 100644 --- a/components/style/values/generics/image.rs +++ b/components/style/values/generics/image.rs @@ -18,13 +18,13 @@ use values::specified::url::SpecifiedUrl; /// [image]: https://drafts.csswg.org/css-images/#image-values #[derive(Clone, PartialEq, ToComputedValue)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] -pub enum Image { +pub enum Image { /// A `` image. Url(SpecifiedUrl), /// A `` image. Gradient(Gradient), /// A `-moz-image-rect` image - Rect(ImageRect), + Rect(MozImageRect), /// A `-moz-element(# )` Element(Atom), /// A paint worklet image. @@ -157,7 +157,7 @@ impl ToCss for PaintWorklet { #[derive(Clone, Debug, PartialEq, ToComputedValue)] #[cfg_attr(feature = "servo", derive(HeapSizeOf))] #[allow(missing_docs)] -pub struct ImageRect { +pub struct MozImageRect { pub url: SpecifiedUrl, pub top: NumberOrPercentage, pub bottom: NumberOrPercentage, @@ -330,7 +330,7 @@ impl fmt::Debug for ColorStop } } -impl ToCss for ImageRect +impl ToCss for MozImageRect where C: ToCss, { fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { diff --git a/components/style/values/specified/image.rs b/components/style/values/specified/image.rs index 1684cc7ecd9..a5503ba62fb 100644 --- a/components/style/values/specified/image.rs +++ b/components/style/values/specified/image.rs @@ -24,8 +24,8 @@ use values::computed::{Context, Position as ComputedPosition, ToComputedValue}; use values::generics::image::{Circle, CompatMode, Ellipse, ColorStop as GenericColorStop}; use values::generics::image::{EndingShape as GenericEndingShape, Gradient as GenericGradient}; use values::generics::image::{GradientItem as GenericGradientItem, GradientKind as GenericGradientKind}; -use values::generics::image::{Image as GenericImage, ImageRect as GenericImageRect}; -use values::generics::image::{LineDirection as GenericsLineDirection, ShapeExtent}; +use values::generics::image::{Image as GenericImage, LineDirection as GenericsLineDirection}; +use values::generics::image::{MozImageRect as GenericMozImageRect, ShapeExtent}; use values::generics::image::PaintWorklet; use values::generics::position::Position as GenericPosition; use values::specified::{Angle, Color, Length, LengthOrPercentage}; @@ -38,7 +38,7 @@ pub type ImageLayer = Either; /// Specified values for an image according to CSS-IMAGES. /// https://drafts.csswg.org/css-images/#image-values -pub type Image = GenericImage; +pub type Image = GenericImage; /// Specified values for a CSS gradient. /// https://drafts.csswg.org/css-images/#gradients @@ -146,7 +146,7 @@ impl Parse for Image { return Ok(GenericImage::PaintWorklet(paint_worklet)); } } - if let Ok(mut image_rect) = input.try(|input| ImageRect::parse(context, input)) { + if let Ok(mut image_rect) = input.try(|input| MozImageRect::parse(context, input)) { #[cfg(feature = "gecko")] { image_rect.url.build_image_value(); @@ -885,7 +885,7 @@ impl Parse for PaintWorklet { } } -impl Parse for ImageRect { +impl Parse for MozImageRect { fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { input.try(|i| i.expect_function_matching("-moz-image-rect"))?; input.parse_nested_block(|i| { @@ -900,7 +900,7 @@ impl Parse for ImageRect { i.expect_comma()?; let left = NumberOrPercentage::parse_non_negative(context, i)?; - Ok(ImageRect { + Ok(MozImageRect { url: url, top: top, right: right, diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index 7539bd575b0..a5e20879af9 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -37,7 +37,7 @@ pub use self::flex::FlexBasis; #[cfg(feature = "gecko")] pub use self::gecko::ScrollSnapPoint; pub use self::image::{ColorStop, EndingShape as GradientEndingShape, Gradient}; -pub use self::image::{GradientItem, GradientKind, Image, ImageRect, ImageLayer}; +pub use self::image::{GradientItem, GradientKind, Image, ImageLayer, MozImageRect}; pub use self::length::{AbsoluteLength, CalcLengthOrPercentage, CharacterWidth}; pub use self::length::{FontRelativeLength, Length, LengthOrNone, LengthOrNumber}; pub use self::length::{LengthOrPercentage, LengthOrPercentageOrAuto};