Bug 1374161 - Clone the url data of paint server. r?hiro draft
authorMantaroh Yoshinaga <mantaroh@gmail.com>
Wed, 05 Jul 2017 14:19:47 +0900
changeset 604039 5022caca1ad1e139d960f82a1652154fb3c7c789
parent 603384 53a5192b436827f667db9df036b07d245e35d97a
child 604040 7745b1b418c570f6706d19d6d48271322676f4e2
child 604045 b31e7905874fb878e425566d4b98e1f78fb20d0a
push id66930
push usermantaroh@gmail.com
push dateWed, 05 Jul 2017 05:20:40 +0000
reviewershiro
bugs1374161
milestone56.0a1
Bug 1374161 - Clone the url data of paint server. r?hiro MozReview-Commit-ID: EU38zosUZJd
servo/components/style/properties/gecko.mako.rs
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -313,31 +313,37 @@ def set_gecko_property(ffi_name, expr):
                 & ${get_gecko_property(gecko_ffi_name, "other")}
             );
         }
     }
 
     #[allow(non_snake_case)]
     pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T {
         use values::generics::{SVGPaint, SVGPaintKind};
+        use values::specified::url::SpecifiedUrl;
         use self::structs::nsStyleSVGPaintType;
         use self::structs::nsStyleSVGFallbackType;
         let ref paint = ${get_gecko_property(gecko_ffi_name)};
         let fallback = if let nsStyleSVGFallbackType::eStyleSVGFallbackType_Color = paint.mFallbackType {
             Some(convert_nscolor_to_rgba(paint.mFallbackColor))
         } else {
             None
         };
         let kind = match paint.mType {
             nsStyleSVGPaintType::eStyleSVGPaintType_None => SVGPaintKind::None,
             nsStyleSVGPaintType::eStyleSVGPaintType_ContextFill => SVGPaintKind::ContextFill,
             nsStyleSVGPaintType::eStyleSVGPaintType_ContextStroke => SVGPaintKind::ContextStroke,
             nsStyleSVGPaintType::eStyleSVGPaintType_Server => {
-                // FIXME (bug 1353966) this should animate
-                SVGPaintKind::None
+                unsafe {
+                    SVGPaintKind::PaintServer(
+                        SpecifiedUrl::from_url_value_data(
+                            &(**paint.mPaint.mPaintServer.as_ref())._base
+                        ).unwrap()
+                    )
+                }
             }
             nsStyleSVGPaintType::eStyleSVGPaintType_Color => {
                 unsafe { SVGPaintKind::Color(convert_nscolor_to_rgba(*paint.mPaint.mColor.as_ref())) }
             }
         };
         SVGPaint {
             kind: kind,
             fallback: fallback,