diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index c262af439ca..03265c7214a 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -667,14 +667,14 @@ def set_gecko_property(ffi_name, expr): SVGPaintKind::Color(color) => { paint.mType = nsStyleSVGPaintType::eStyleSVGPaintType_Color; unsafe { - *paint.mPaint.mColor.as_mut() = convert_rgba_to_nscolor(&color); + *paint.mPaint.mColor.as_mut() = color.into(); } } } paint.mFallbackType = match fallback { Some(Either::First(color)) => { - paint.mFallbackColor = convert_rgba_to_nscolor(&color); + paint.mFallbackColor = color.into(); nsStyleSVGFallbackType::eStyleSVGFallbackType_Color }, Some(Either::Second(_)) => { @@ -709,7 +709,7 @@ def set_gecko_property(ffi_name, expr): let fallback = match paint.mFallbackType { nsStyleSVGFallbackType::eStyleSVGFallbackType_Color => { - Some(Either::First(convert_nscolor_to_rgba(paint.mFallbackColor))) + Some(Either::First(paint.mFallbackColor.into())) }, nsStyleSVGFallbackType::eStyleSVGFallbackType_None => { Some(Either::Second(None_)) @@ -728,7 +728,8 @@ def set_gecko_property(ffi_name, expr): }) } nsStyleSVGPaintType::eStyleSVGPaintType_Color => { - unsafe { SVGPaintKind::Color(convert_nscolor_to_rgba(*paint.mPaint.mColor.as_ref())) } + let col = unsafe { *paint.mPaint.mColor.as_ref() }; + SVGPaintKind::Color(col.into()) } }; SVGPaint { diff --git a/components/style/properties/helpers/animated_properties.mako.rs b/components/style/properties/helpers/animated_properties.mako.rs index d4a96e1f177..a51860f9a19 100644 --- a/components/style/properties/helpers/animated_properties.mako.rs +++ b/components/style/properties/helpers/animated_properties.mako.rs @@ -29,7 +29,7 @@ use hash::FnvHashMap; use super::ComputedValues; use values::CSSFloat; use values::animated::{Animate, Procedure, ToAnimatedValue, ToAnimatedZero}; -use values::animated::color::RGBA as AnimatedRGBA; +use values::animated::color::Color as AnimatedColor; use values::animated::effects::Filter as AnimatedFilter; #[cfg(feature = "gecko")] use values::computed::TransitionProperty; use values::computed::{Angle, CalcLengthOrPercentage}; @@ -2674,10 +2674,10 @@ impl ComputeSquaredDistance for ComputedTransform { } /// Animated SVGPaint -pub type IntermediateSVGPaint = SVGPaint; +pub type IntermediateSVGPaint = SVGPaint; /// Animated SVGPaintKind -pub type IntermediateSVGPaintKind = SVGPaintKind; +pub type IntermediateSVGPaintKind = SVGPaintKind; impl ToAnimatedZero for IntermediateSVGPaint { #[inline] diff --git a/components/style/values/computed/svg.rs b/components/style/values/computed/svg.rs index fd908580b13..ab9bbd18b4e 100644 --- a/components/style/values/computed/svg.rs +++ b/components/style/values/computed/svg.rs @@ -9,6 +9,7 @@ use values::RGBA; use values::computed::{LengthOrPercentage, NonNegativeLength}; use values::computed::{NonNegativeLengthOrPercentage, NonNegativeNumber, Number}; use values::computed::Opacity; +use values::computed::color::Color; use values::computed::url::ComputedUrl; use values::generics::svg as generic; @@ -17,9 +18,9 @@ pub use values::specified::SVGPaintOrder; pub use values::specified::MozContextProperties; /// Computed SVG Paint value -pub type SVGPaint = generic::SVGPaint; +pub type SVGPaint = generic::SVGPaint; /// Computed SVG Paint Kind value -pub type SVGPaintKind = generic::SVGPaintKind; +pub type SVGPaintKind = generic::SVGPaintKind; impl Default for SVGPaint { fn default() -> Self { @@ -33,7 +34,7 @@ impl Default for SVGPaint { impl SVGPaint { /// Opaque black color pub fn black() -> Self { - let rgba = RGBA::from_floats(0., 0., 0., 1.); + let rgba = RGBA::from_floats(0., 0., 0., 1.).into(); SVGPaint { kind: generic::SVGPaintKind::Color(rgba), fallback: None, diff --git a/components/style/values/specified/svg.rs b/components/style/values/specified/svg.rs index 766f36cfc1e..e55442d7da8 100644 --- a/components/style/values/specified/svg.rs +++ b/components/style/values/specified/svg.rs @@ -13,14 +13,14 @@ use values::CustomIdent; use values::generics::svg as generic; use values::specified::{LengthOrPercentage, NonNegativeLengthOrPercentage, NonNegativeNumber}; use values::specified::{Number, Opacity}; -use values::specified::color::RGBAColor; +use values::specified::color::Color; use values::specified::url::SpecifiedUrl; /// Specified SVG Paint value -pub type SVGPaint = generic::SVGPaint; +pub type SVGPaint = generic::SVGPaint; /// Specified SVG Paint Kind value -pub type SVGPaintKind = generic::SVGPaintKind; +pub type SVGPaintKind = generic::SVGPaintKind; #[cfg(feature = "gecko")] fn is_context_value_enabled() -> bool {