From 326f9140180dec424a6ee1fef9a42063920e6f79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 24 Oct 2017 14:22:11 +0200 Subject: [PATCH 1/3] style: Do not require to import ToCss in define_css_keyword_enum. --- components/style/properties/helpers.mako.rs | 4 +--- components/style/properties/longhand/border.mako.rs | 3 --- components/style/properties/longhand/inherited_text.mako.rs | 3 --- components/style/stylesheets/viewport_rule.rs | 2 +- components/style/values/specified/color.rs | 2 -- components/style_traits/values.rs | 2 +- components/style_traits/viewport.rs | 4 ++-- 7 files changed, 5 insertions(+), 15 deletions(-) diff --git a/components/style/properties/helpers.mako.rs b/components/style/properties/helpers.mako.rs index 2abf80a0a9b..559034078ce 100644 --- a/components/style/properties/helpers.mako.rs +++ b/components/style/properties/helpers.mako.rs @@ -439,7 +439,7 @@ use cssparser::Parser; use parser::{Parse, ParserContext}; - use style_traits::{ToCss, ParseError}; + use style_traits::ParseError; define_css_keyword_enum! { T: % for value in keyword.values_for(product): "${value}" => ${to_rust_ident(value)}, @@ -614,7 +614,6 @@ <%def name="inner_body(keyword, extra_specified=None, needs_conversion=False)"> % if extra_specified or keyword.aliases_for(product): - use style_traits::ToCss; define_css_keyword_enum! { SpecifiedValue: values { % for value in keyword.values_for(product) + (extra_specified or "").split(): @@ -631,7 +630,6 @@ pub use self::computed_value::T as SpecifiedValue; % endif pub mod computed_value { - use style_traits::ToCss; define_css_keyword_enum! { T: % for value in data.longhands_by_name[name].keyword.values_for(product): "${value}" => ${to_rust_ident(value)}, diff --git a/components/style/properties/longhand/border.mako.rs b/components/style/properties/longhand/border.mako.rs index 7e33bb886f1..070a68b85f0 100644 --- a/components/style/properties/longhand/border.mako.rs +++ b/components/style/properties/longhand/border.mako.rs @@ -222,9 +222,6 @@ ${helpers.predefined_type("border-image-outset", "LengthOrNumberRect", <%helpers:longhand name="border-image-repeat" animation_value_type="discrete" flags="APPLIES_TO_FIRST_LETTER" spec="https://drafts.csswg.org/css-backgrounds/#border-image-repeat"> - use style_traits::ToCss; - - pub mod computed_value { pub use super::RepeatKeyword; diff --git a/components/style/properties/longhand/inherited_text.mako.rs b/components/style/properties/longhand/inherited_text.mako.rs index 5416433bedd..981132730a9 100644 --- a/components/style/properties/longhand/inherited_text.mako.rs +++ b/components/style/properties/longhand/inherited_text.mako.rs @@ -112,7 +112,6 @@ ${helpers.single_keyword("text-align-last", flags="APPLIES_TO_PLACEHOLDER" spec="https://drafts.csswg.org/css-text/#propdef-text-align"> pub mod computed_value { - use style_traits::ToCss; macro_rules! define_text_align { ( $( $name: ident ( $string: expr ) => $discriminant: expr, )+ ) => { define_css_keyword_enum! { T: @@ -584,8 +583,6 @@ ${helpers.predefined_type( <%helpers:longhand name="text-emphasis-position" animation_value_type="discrete" products="gecko" spec="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position"> - use style_traits::ToCss; - define_css_keyword_enum!(HorizontalWritingModeValue: "over" => Over, "under" => Under); diff --git a/components/style/stylesheets/viewport_rule.rs b/components/style/stylesheets/viewport_rule.rs index ddb91955e64..710f53609b7 100644 --- a/components/style/stylesheets/viewport_rule.rs +++ b/components/style/stylesheets/viewport_rule.rs @@ -10,7 +10,7 @@ use app_units::Au; use context::QuirksMode; use cssparser::{AtRuleParser, DeclarationListParser, DeclarationParser, Parser, parse_important}; -use cssparser::{CowRcStr, ToCss as ParserToCss}; +use cssparser::CowRcStr; use error_reporting::{ContextualParseError, ParseErrorReporter}; use euclid::TypedSize2D; use font_metrics::get_metrics_provider_for_product; diff --git a/components/style/values/specified/color.rs b/components/style/values/specified/color.rs index 7a7a8593e9e..a9f83e0d471 100644 --- a/components/style/values/specified/color.rs +++ b/components/style/values/specified/color.rs @@ -46,8 +46,6 @@ pub enum Color { #[cfg(feature = "gecko")] mod gecko { - use style_traits::ToCss; - define_css_keyword_enum! { SpecialColorKeyword: "-moz-default-color" => MozDefaultColor, "-moz-default-background-color" => MozDefaultBackgroundColor, diff --git a/components/style_traits/values.rs b/components/style_traits/values.rs index 610e2020a3b..9b2b308d5d1 100644 --- a/components/style_traits/values.rs +++ b/components/style_traits/values.rs @@ -472,7 +472,7 @@ macro_rules! __define_css_keyword_enum__actual { } } - impl ToCss for $name { + impl $crate::ToCss for $name { fn to_css(&self, dest: &mut W) -> ::std::fmt::Result where W: ::std::fmt::Write { diff --git a/components/style_traits/viewport.rs b/components/style_traits/viewport.rs index 352616d941e..183c41c2a80 100644 --- a/components/style_traits/viewport.rs +++ b/components/style_traits/viewport.rs @@ -4,8 +4,8 @@ //! Helper types for the `@viewport` rule. -use {CSSPixel, PinchZoomFactor, ParseError}; -use cssparser::{Parser, ToCss}; +use {CSSPixel, PinchZoomFactor, ParseError, ToCss}; +use cssparser::Parser; use euclid::TypedSize2D; use std::ascii::AsciiExt; use std::fmt; From fd1e2c1f3f2dff4265426457f8591951f62fd8f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 24 Oct 2017 14:30:12 +0200 Subject: [PATCH 2/3] style: Move background-repeat and mask-repeat outside of mako. --- components/layout/display_list_builder.rs | 19 ++-- components/style/properties/gecko.mako.rs | 4 +- .../properties/longhand/background.mako.rs | 105 ++---------------- .../style/properties/longhand/svg.mako.rs | 28 ++--- .../style/values/computed/background.rs | 73 ++++++++++++ components/style/values/computed/mod.rs | 2 +- .../style/values/specified/background.rs | 61 +++++++++- components/style/values/specified/mod.rs | 2 +- 8 files changed, 168 insertions(+), 126 deletions(-) diff --git a/components/layout/display_list_builder.rs b/components/layout/display_list_builder.rs index 4baa85f95b4..2d0c68ed8ba 100644 --- a/components/layout/display_list_builder.rs +++ b/components/layout/display_list_builder.rs @@ -48,7 +48,7 @@ use std::default::Default; use std::mem; use std::sync::Arc; use style::computed_values::{background_attachment, background_clip, background_origin}; -use style::computed_values::{background_repeat, border_style, cursor}; +use style::computed_values::{border_style, cursor}; use style::computed_values::{image_rendering, overflow_x, pointer_events, position, visibility}; use style::logical_geometry::{LogicalMargin, LogicalPoint, LogicalRect, LogicalSize, WritingMode}; use style::properties::ComputedValues; @@ -66,6 +66,7 @@ use style::values::generics::image::{Circle, Ellipse, EndingShape as GenericEndi use style::values::generics::image::{GradientItem as GenericGradientItem, GradientKind}; use style::values::generics::image::{Image, ShapeExtent}; use style::values::generics::image::PaintWorklet; +use style::values::specified::background::RepeatKeyword as BackgroundRepeatKeyword; use style::values::specified::position::{X, Y}; use style_traits::CSSPixel; use style_traits::ToCss; @@ -1177,17 +1178,17 @@ impl FragmentDisplayListBuilding for Fragment { // Adjust origin and size based on background-repeat let background_repeat = get_cyclic(&background.background_repeat.0, index); match background_repeat.0 { - background_repeat::single_value::RepeatKeyword::NoRepeat => { + BackgroundRepeatKeyword::NoRepeat => { bounds.origin.x = anchor_origin_x; bounds.size.width = image_size.width; } - background_repeat::single_value::RepeatKeyword::Repeat => { + BackgroundRepeatKeyword::Repeat => { ImageFragmentInfo::tile_image(&mut bounds.origin.x, &mut bounds.size.width, anchor_origin_x, image_size.width); } - background_repeat::single_value::RepeatKeyword::Space => { + BackgroundRepeatKeyword::Space => { ImageFragmentInfo::tile_image_spaced(&mut bounds.origin.x, &mut bounds.size.width, &mut tile_spacing.width, @@ -1195,7 +1196,7 @@ impl FragmentDisplayListBuilding for Fragment { image_size.width); } - background_repeat::single_value::RepeatKeyword::Round => { + BackgroundRepeatKeyword::Round => { ImageFragmentInfo::tile_image_round(&mut bounds.origin.x, &mut bounds.size.width, anchor_origin_x, @@ -1203,17 +1204,17 @@ impl FragmentDisplayListBuilding for Fragment { } }; match background_repeat.1 { - background_repeat::single_value::RepeatKeyword::NoRepeat => { + BackgroundRepeatKeyword::NoRepeat => { bounds.origin.y = anchor_origin_y; bounds.size.height = image_size.height; } - background_repeat::single_value::RepeatKeyword::Repeat => { + BackgroundRepeatKeyword::Repeat => { ImageFragmentInfo::tile_image(&mut bounds.origin.y, &mut bounds.size.height, anchor_origin_y, image_size.height); } - background_repeat::single_value::RepeatKeyword::Space => { + BackgroundRepeatKeyword::Space => { ImageFragmentInfo::tile_image_spaced(&mut bounds.origin.y, &mut bounds.size.height, &mut tile_spacing.height, @@ -1221,7 +1222,7 @@ impl FragmentDisplayListBuilding for Fragment { image_size.height); } - background_repeat::single_value::RepeatKeyword::Round => { + BackgroundRepeatKeyword::Round => { ImageFragmentInfo::tile_image_round(&mut bounds.origin.y, &mut bounds.size.height, anchor_origin_y, diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 7831f76aabd..2de9697dfad 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -3659,7 +3659,7 @@ fn static_assert() { %> <%self:simple_image_array_property name="repeat" shorthand="${shorthand}" field_name="mRepeat"> - use properties::longhands::${shorthand}_repeat::single_value::computed_value::RepeatKeyword; + use values::specified::background::RepeatKeyword; use gecko_bindings::structs::nsStyleImageLayers_Repeat; use gecko_bindings::structs::StyleImageLayerRepeat; @@ -3682,7 +3682,7 @@ fn static_assert() { pub fn clone_${shorthand}_repeat(&self) -> longhands::${shorthand}_repeat::computed_value::T { use properties::longhands::${shorthand}_repeat::single_value::computed_value::T; - use properties::longhands::${shorthand}_repeat::single_value::computed_value::RepeatKeyword; + use values::specified::background::RepeatKeyword; use gecko_bindings::structs::StyleImageLayerRepeat; fn to_servo(repeat: StyleImageLayerRepeat) -> RepeatKeyword { diff --git a/components/style/properties/longhand/background.mako.rs b/components/style/properties/longhand/background.mako.rs index 069f272e4c1..7518977522c 100644 --- a/components/style/properties/longhand/background.mako.rs +++ b/components/style/properties/longhand/background.mako.rs @@ -40,101 +40,16 @@ ${helpers.predefined_type("background-image", "ImageLayer", )} % endfor -<%helpers:vector_longhand name="background-repeat" animation_value_type="discrete" - spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat" - flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER"> - use std::fmt; - use style_traits::ToCss; - - define_css_keyword_enum!(RepeatKeyword: - "repeat" => Repeat, - "space" => Space, - "round" => Round, - "no-repeat" => NoRepeat); - - #[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] - pub enum SpecifiedValue { - RepeatX, - RepeatY, - Other(RepeatKeyword, Option), - } - - pub mod computed_value { - pub use super::RepeatKeyword; - - #[derive(Clone, Debug, MallocSizeOf, PartialEq)] - pub struct T(pub RepeatKeyword, pub RepeatKeyword); - } - - - impl ToCss for computed_value::T { - fn to_css(&self, dest: &mut W) -> fmt::Result where W: fmt::Write { - match (self.0, self.1) { - (RepeatKeyword::Repeat, RepeatKeyword::NoRepeat) => dest.write_str("repeat-x"), - (RepeatKeyword::NoRepeat, RepeatKeyword::Repeat) => dest.write_str("repeat-y"), - (horizontal, vertical) => { - horizontal.to_css(dest)?; - if horizontal != vertical { - dest.write_str(" ")?; - vertical.to_css(dest)?; - } - Ok(()) - }, - } - } - } - - #[inline] - pub fn get_initial_value() -> computed_value::T { - computed_value::T(RepeatKeyword::Repeat, RepeatKeyword::Repeat) - } - - #[inline] - pub fn get_initial_specified_value() -> SpecifiedValue { - SpecifiedValue::Other(RepeatKeyword::Repeat, None) - } - - impl ToComputedValue for SpecifiedValue { - type ComputedValue = computed_value::T; - - #[inline] - fn to_computed_value(&self, _context: &Context) -> computed_value::T { - match *self { - SpecifiedValue::RepeatX => - computed_value::T(RepeatKeyword::Repeat, RepeatKeyword::NoRepeat), - SpecifiedValue::RepeatY => - computed_value::T(RepeatKeyword::NoRepeat, RepeatKeyword::Repeat), - SpecifiedValue::Other(horizontal, vertical) => - computed_value::T(horizontal, vertical.unwrap_or(horizontal)) - } - } - - #[inline] - fn from_computed_value(computed: &computed_value::T) -> Self { - match (computed.0, computed.1) { - (RepeatKeyword::Repeat, RepeatKeyword::NoRepeat) => SpecifiedValue::RepeatX, - (RepeatKeyword::NoRepeat, RepeatKeyword::Repeat) => SpecifiedValue::RepeatY, - (horizontal, vertical) => SpecifiedValue::Other(horizontal, Some(vertical)), - } - } - } - - pub fn parse<'i, 't>(_context: &ParserContext, input: &mut Parser<'i, 't>) - -> Result> { - let ident = input.expect_ident_cloned()?; - (match_ignore_ascii_case! { &ident, - "repeat-x" => Ok(SpecifiedValue::RepeatX), - "repeat-y" => Ok(SpecifiedValue::RepeatY), - _ => Err(()), - }).or_else(|()| { - let horizontal: Result<_, ParseError> = RepeatKeyword::from_ident(&ident) - .map_err(|()| input.new_custom_error(SelectorParseErrorKind::UnexpectedIdent(ident.clone()))); - let horizontal = horizontal?; - let vertical = input.try(RepeatKeyword::parse).ok(); - Ok(SpecifiedValue::Other(horizontal, vertical)) - }) - } - +${helpers.predefined_type( + "background-repeat", + "BackgroundRepeat", + "computed::BackgroundRepeat::repeat()", + initial_specified_value="specified::BackgroundRepeat::repeat()", + animation_value_type="discrete", + vector=True, + spec="https://drafts.csswg.org/css-backgrounds/#the-background-repeat", + flags="APPLIES_TO_FIRST_LETTER APPLIES_TO_FIRST_LINE APPLIES_TO_PLACEHOLDER", +)} ${helpers.single_keyword("background-attachment", "scroll fixed" + (" local" if product == "gecko" else ""), diff --git a/components/style/properties/longhand/svg.mako.rs b/components/style/properties/longhand/svg.mako.rs index 5fe3f1f96a0..691b6870421 100644 --- a/components/style/properties/longhand/svg.mako.rs +++ b/components/style/properties/longhand/svg.mako.rs @@ -81,23 +81,17 @@ ${helpers.single_keyword("mask-mode", animation_value_type="discrete", spec="https://drafts.fxtf.org/css-masking/#propdef-mask-mode")} -<%helpers:vector_longhand name="mask-repeat" products="gecko" animation_value_type="discrete" extra_prefixes="webkit" - spec="https://drafts.fxtf.org/css-masking/#propdef-mask-repeat"> - pub use properties::longhands::background_repeat::single_value::parse; - pub use properties::longhands::background_repeat::single_value::SpecifiedValue; - pub use properties::longhands::background_repeat::single_value::computed_value; - pub use properties::longhands::background_repeat::single_value::RepeatKeyword; - - #[inline] - pub fn get_initial_value() -> computed_value::T { - computed_value::T(RepeatKeyword::Repeat, RepeatKeyword::Repeat) - } - - #[inline] - pub fn get_initial_specified_value() -> SpecifiedValue { - SpecifiedValue::Other(RepeatKeyword::Repeat, None) - } - +${helpers.predefined_type( + "mask-repeat", + "BackgroundRepeat", + "computed::BackgroundRepeat::repeat()", + initial_specified_value="specified::BackgroundRepeat::repeat()", + products="gecko", + extra_prefixes="webkit", + animation_value_type="discrete", + spec="https://drafts.fxtf.org/css-masking/#propdef-mask-repeat", + vector=True, +)} % for (axis, direction) in [("x", "Horizontal"), ("y", "Vertical")]: ${helpers.predefined_type( diff --git a/components/style/values/computed/background.rs b/components/style/values/computed/background.rs index c618fb66c15..e71f208c984 100644 --- a/components/style/values/computed/background.rs +++ b/components/style/values/computed/background.rs @@ -6,9 +6,13 @@ use properties::animated_properties::RepeatableListAnimatable; use properties::longhands::background_size::computed_value::T as BackgroundSizeList; +use std::fmt; +use style_traits::ToCss; use values::animated::{ToAnimatedValue, ToAnimatedZero}; +use values::computed::{Context, ToComputedValue}; use values::computed::length::LengthOrPercentageOrAuto; use values::generics::background::BackgroundSize as GenericBackgroundSize; +use values::specified::background::{BackgroundRepeat as SpecifiedBackgroundRepeat, RepeatKeyword}; /// A computed value for the `background-size` property. pub type BackgroundSize = GenericBackgroundSize; @@ -77,3 +81,72 @@ impl ToAnimatedValue for BackgroundSizeList { BackgroundSizeList(ToAnimatedValue::from_animated_value(animated.0)) } } + +/// The computed value of the `background-repeat` property: +/// +/// https://drafts.csswg.org/css-backgrounds/#the-background-repeat +#[derive(Clone, Debug, MallocSizeOf, PartialEq)] +pub struct BackgroundRepeat(pub RepeatKeyword, pub RepeatKeyword); + +impl BackgroundRepeat { + /// Returns the `repeat repeat` value. + pub fn repeat() -> Self { + BackgroundRepeat(RepeatKeyword::Repeat, RepeatKeyword::Repeat) + } +} + +impl ToCss for BackgroundRepeat { + fn to_css(&self, dest: &mut W) -> fmt::Result + where + W: fmt::Write, + { + match (self.0, self.1) { + (RepeatKeyword::Repeat, RepeatKeyword::NoRepeat) => dest.write_str("repeat-x"), + (RepeatKeyword::NoRepeat, RepeatKeyword::Repeat) => dest.write_str("repeat-y"), + (horizontal, vertical) => { + horizontal.to_css(dest)?; + if horizontal != vertical { + dest.write_str(" ")?; + vertical.to_css(dest)?; + } + Ok(()) + }, + } + } +} + +impl ToComputedValue for SpecifiedBackgroundRepeat { + type ComputedValue = BackgroundRepeat; + + #[inline] + fn to_computed_value(&self, _: &Context) -> Self::ComputedValue { + match *self { + SpecifiedBackgroundRepeat::RepeatX => { + BackgroundRepeat(RepeatKeyword::Repeat, RepeatKeyword::NoRepeat) + } + SpecifiedBackgroundRepeat::RepeatY => { + BackgroundRepeat(RepeatKeyword::NoRepeat, RepeatKeyword::Repeat) + } + SpecifiedBackgroundRepeat::Keywords(horizontal, vertical) => { + BackgroundRepeat(horizontal, vertical.unwrap_or(horizontal)) + } + } + } + + #[inline] + fn from_computed_value(computed: &Self::ComputedValue) -> Self { + // FIXME(emilio): Why can't this just be: + // SpecifiedBackgroundRepeat::Keywords(computed.0, computed.1) + match (computed.0, computed.1) { + (RepeatKeyword::Repeat, RepeatKeyword::NoRepeat) => { + SpecifiedBackgroundRepeat::RepeatX + } + (RepeatKeyword::NoRepeat, RepeatKeyword::Repeat) => { + SpecifiedBackgroundRepeat::RepeatY + } + (horizontal, vertical) => { + SpecifiedBackgroundRepeat::Keywords(horizontal, Some(vertical)) + } + } + } +} diff --git a/components/style/values/computed/mod.rs b/components/style/values/computed/mod.rs index 8dc286cc6bc..c12c5c18be0 100644 --- a/components/style/values/computed/mod.rs +++ b/components/style/values/computed/mod.rs @@ -33,7 +33,7 @@ pub use properties::animated_properties::TransitionProperty; #[cfg(feature = "gecko")] pub use self::align::{AlignItems, AlignJustifyContent, AlignJustifySelf, JustifyItems}; pub use self::angle::Angle; -pub use self::background::BackgroundSize; +pub use self::background::{BackgroundSize, BackgroundRepeat}; pub use self::border::{BorderImageSlice, BorderImageWidth, BorderImageSideWidth}; pub use self::border::{BorderRadius, BorderCornerRadius, BorderSpacing}; pub use self::box_::VerticalAlign; diff --git a/components/style/values/specified/background.rs b/components/style/values/specified/background.rs index dd9949adf26..52383deb460 100644 --- a/components/style/values/specified/background.rs +++ b/components/style/values/specified/background.rs @@ -15,7 +15,10 @@ use values::specified::length::LengthOrPercentageOrAuto; pub type BackgroundSize = GenericBackgroundSize; impl Parse for BackgroundSize { - fn parse<'i, 't>(context: &ParserContext, input: &mut Parser<'i, 't>) -> Result> { + fn parse<'i, 't>( + context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result> { if let Ok(width) = input.try(|i| LengthOrPercentageOrAuto::parse_non_negative(context, i)) { let height = input .try(|i| LengthOrPercentageOrAuto::parse_non_negative(context, i)) @@ -41,3 +44,59 @@ impl BackgroundSize { } } } + +/// One of the keywords for `background-repeat`. +define_css_keyword_enum! { RepeatKeyword: + "repeat" => Repeat, + "space" => Space, + "round" => Round, + "no-repeat" => NoRepeat +} + +/// The specified value for the `background-repeat` property. +/// +/// https://drafts.csswg.org/css-backgrounds/#the-background-repeat +#[derive(Clone, Debug, MallocSizeOf, PartialEq, ToCss)] +pub enum BackgroundRepeat { + /// `repeat-x` + RepeatX, + /// `repeat-y` + RepeatY, + /// `[repeat | space | round | no-repeat]{1,2}` + Keywords(RepeatKeyword, Option), +} + +impl BackgroundRepeat { + /// Returns the `repeat` value. + #[inline] + pub fn repeat() -> Self { + BackgroundRepeat::Keywords(RepeatKeyword::Repeat, None) + } +} + +impl Parse for BackgroundRepeat { + fn parse<'i, 't>( + _context: &ParserContext, + input: &mut Parser<'i, 't>, + ) -> Result> { + let ident = input.expect_ident_cloned()?; + + match_ignore_ascii_case! { &ident, + "repeat-x" => return Ok(BackgroundRepeat::RepeatX), + "repeat-y" => return Ok(BackgroundRepeat::RepeatY), + _ => {}, + } + + let horizontal = match RepeatKeyword::from_ident(&ident) { + Ok(h) => h, + Err(()) => { + return Err(input.new_custom_error( + SelectorParseErrorKind::UnexpectedIdent(ident.clone()) + )); + } + }; + + let vertical = input.try(RepeatKeyword::parse).ok(); + Ok(BackgroundRepeat::Keywords(horizontal, vertical)) + } +} diff --git a/components/style/values/specified/mod.rs b/components/style/values/specified/mod.rs index acd73f2b930..1f70336d9f9 100644 --- a/components/style/values/specified/mod.rs +++ b/components/style/values/specified/mod.rs @@ -27,7 +27,7 @@ pub use properties::animated_properties::TransitionProperty; pub use self::angle::Angle; #[cfg(feature = "gecko")] pub use self::align::{AlignItems, AlignJustifyContent, AlignJustifySelf, JustifyItems}; -pub use self::background::BackgroundSize; +pub use self::background::{BackgroundRepeat, BackgroundSize}; pub use self::border::{BorderCornerRadius, BorderImageSlice, BorderImageWidth}; pub use self::border::{BorderImageSideWidth, BorderRadius, BorderSideWidth, BorderSpacing}; pub use self::box_::VerticalAlign; From e5781533c4c02c9156ded340bc3c11af9250e947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Tue, 24 Oct 2017 14:39:00 +0200 Subject: [PATCH 3/3] style: Remove unused From impl. --- components/style/values/generics/size.rs | 6 ------ 1 file changed, 6 deletions(-) diff --git a/components/style/values/generics/size.rs b/components/style/values/generics/size.rs index 784adf62880..ed5b7a516f7 100644 --- a/components/style/values/generics/size.rs +++ b/components/style/values/generics/size.rs @@ -52,12 +52,6 @@ impl Size { } } -impl From for Size { - fn from(size: L) -> Self { - Self::new(size.clone(), size) - } -} - impl ToCss for Size where L: ToCss + PartialEq,