From 4924a4832f38ace472fd87366763de0255e2c00d Mon Sep 17 00:00:00 2001 From: Daisuke Akatsuka Date: Wed, 5 Jul 2017 13:08:12 +0900 Subject: [PATCH] implements URLValue type properties animatable --- components/style/properties/gecko.mako.rs | 15 ++++++++++++++- .../properties/longhand/inherited_svg.mako.rs | 6 +++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/components/style/properties/gecko.mako.rs b/components/style/properties/gecko.mako.rs index 402ce7ef4b1..a196fec9f1f 100644 --- a/components/style/properties/gecko.mako.rs +++ b/components/style/properties/gecko.mako.rs @@ -668,7 +668,20 @@ def set_gecko_property(ffi_name, expr): } } % if need_clone: - <% raise Exception("Do not know how to handle clone ") %> + pub fn clone_${ident}(&self) -> longhands::${ident}::computed_value::T { + use values::specified::url::SpecifiedUrl; + use values::None_; + + if self.gecko.${gecko_ffi_name}.mRawPtr.is_null() { + Either::Second(None_) + } else { + unsafe { + let ref gecko_url_value = *self.gecko.${gecko_ffi_name}.mRawPtr; + Either::First(SpecifiedUrl::from_url_value_data(&gecko_url_value._base) + .expect("${gecko_ffi_name} could not convert to SpecifiedUrl")) + } + } + } % endif diff --git a/components/style/properties/longhand/inherited_svg.mako.rs b/components/style/properties/longhand/inherited_svg.mako.rs index f3a2217d3ac..13ce7492b3c 100644 --- a/components/style/properties/longhand/inherited_svg.mako.rs +++ b/components/style/properties/longhand/inherited_svg.mako.rs @@ -119,19 +119,19 @@ ${helpers.single_keyword("clip-rule", "nonzero evenodd", ${helpers.predefined_type("marker-start", "UrlOrNone", "Either::Second(None_)", products="gecko", boxed="True" if product == "gecko" else "False", - animation_value_type="none", + animation_value_type="discrete", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} ${helpers.predefined_type("marker-mid", "UrlOrNone", "Either::Second(None_)", products="gecko", boxed="True" if product == "gecko" else "False", - animation_value_type="none", + animation_value_type="discrete", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} ${helpers.predefined_type("marker-end", "UrlOrNone", "Either::Second(None_)", products="gecko", boxed="True" if product == "gecko" else "False", - animation_value_type="none", + animation_value_type="discrete", spec="https://www.w3.org/TR/SVG2/painting.html#VertexMarkerProperties")} <%helpers:longhand name="paint-order"