Bug 1371115 - Part 11: implements URLValue type properties animatable. r?hiro
In this patch, implements following properties:
* marker-start
* marker-mid
* marker-end
MozReview-Commit-ID: IFBYhsZ39RR
--- a/servo/components/style/properties/gecko.mako.rs
+++ b/servo/components/style/properties/gecko.mako.rs
@@ -663,17 +663,30 @@ def set_gecko_property(ffi_name, expr):
}
#[allow(non_snake_case)]
pub fn copy_${ident}_from(&mut self, other: &Self) {
unsafe {
self.gecko.${gecko_ffi_name}.set(&other.gecko.${gecko_ffi_name});
}
}
% 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
</%def>
<%def name="impl_logical(name, need_clone=False, **kwargs)">
${helpers.logical_setter(name, need_clone)}
</%def>
<%def name="impl_style_struct(style_struct)">
--- a/servo/components/style/properties/longhand/inherited_svg.mako.rs
+++ b/servo/components/style/properties/longhand/inherited_svg.mako.rs
@@ -114,29 +114,29 @@
gecko_enum_prefix="StyleFillRule",
gecko_inexhaustive=True,
animation_value_type="discrete",
spec="https://www.w3.org/TR/SVG11/masking.html#ClipRuleProperty")}
${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"
animation_value_type="none"
products="gecko"
spec="https://www.w3.org/TR/SVG2/painting.html#PaintOrder">
use values::computed::ComputedValueAsSpecified;