Skip to content

Commit

Permalink
Rename ImageRect to MozImageRect
Browse files Browse the repository at this point in the history
  • Loading branch information
nox committed Jul 12, 2017
1 parent 50c46ae commit 907d629
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions components/style/gecko/conversions.rs
Expand Up @@ -370,7 +370,7 @@ impl nsStyleImage {
pub unsafe fn into_image(self: &nsStyleImage) -> Option<Image> {
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 => {
Expand All @@ -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
Expand Down
8 changes: 4 additions & 4 deletions components/style/values/computed/image.rs
Expand Up @@ -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};
Expand All @@ -27,7 +27,7 @@ pub type ImageLayer = Either<None_, Image>;

/// Computed values for an image according to CSS-IMAGES.
/// https://drafts.csswg.org/css-images/#image-values
pub type Image = GenericImage<Gradient, ImageRect>;
pub type Image = GenericImage<Gradient, MozImageRect>;

/// Computed values for a CSS gradient.
/// https://drafts.csswg.org/css-images/#gradients
Expand Down Expand Up @@ -71,8 +71,8 @@ pub type GradientItem = GenericGradientItem<RGBA, LengthOrPercentage>;
/// A computed color stop.
pub type ColorStop = GenericColorStop<RGBA, LengthOrPercentage>;

/// Computed values for ImageRect.
pub type ImageRect = GenericImageRect<NumberOrPercentage>;
/// Computed values for `-moz-image-rect(...)`.
pub type MozImageRect = GenericMozImageRect<NumberOrPercentage>;

impl GenericLineDirection for LineDirection {
fn points_downwards(&self) -> bool {
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/computed/mod.rs
Expand Up @@ -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;
Expand Down
8 changes: 4 additions & 4 deletions components/style/values/generics/image.rs
Expand Up @@ -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<Gradient, ImageRect> {
pub enum Image<Gradient, MozImageRect> {
/// A `<url()>` image.
Url(SpecifiedUrl),
/// A `<gradient>` image.
Gradient(Gradient),
/// A `-moz-image-rect` image
Rect(ImageRect),
Rect(MozImageRect),
/// A `-moz-element(# <element-id>)`
Element(Atom),
/// A paint worklet image.
Expand Down Expand Up @@ -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<NumberOrPercentage> {
pub struct MozImageRect<NumberOrPercentage> {
pub url: SpecifiedUrl,
pub top: NumberOrPercentage,
pub bottom: NumberOrPercentage,
Expand Down Expand Up @@ -330,7 +330,7 @@ impl<C, L> fmt::Debug for ColorStop<C, L>
}
}

impl<C> ToCss for ImageRect<C>
impl<C> ToCss for MozImageRect<C>
where C: ToCss,
{
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
Expand Down
12 changes: 6 additions & 6 deletions components/style/values/specified/image.rs
Expand Up @@ -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};
Expand All @@ -38,7 +38,7 @@ pub type ImageLayer = Either<None_, Image>;

/// Specified values for an image according to CSS-IMAGES.
/// https://drafts.csswg.org/css-images/#image-values
pub type Image = GenericImage<Gradient, ImageRect>;
pub type Image = GenericImage<Gradient, MozImageRect>;

/// Specified values for a CSS gradient.
/// https://drafts.csswg.org/css-images/#gradients
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -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<Self, ParseError<'i>> {
input.try(|i| i.expect_function_matching("-moz-image-rect"))?;
input.parse_nested_block(|i| {
Expand All @@ -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,
Expand Down
2 changes: 1 addition & 1 deletion components/style/values/specified/mod.rs
Expand Up @@ -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};
Expand Down

0 comments on commit 907d629

Please sign in to comment.