implements nsStyleImage type properties animatable

This commit is contained in:
Daisuke Akatsuka 2017-07-05 13:09:21 +09:00
parent 4924a4832f
commit d885747a18
6 changed files with 240 additions and 4 deletions

View file

@ -1085,6 +1085,15 @@ fn static_assert() {
}
}
pub fn clone_border_image_source(&self) -> longhands::border_image_source::computed_value::T {
use values::None_;
match unsafe { self.gecko.mBorderImageSource.into_image() } {
Some(image) => Either::Second(image),
None => Either::First(None_),
}
}
<% impl_style_sides("border_image_outset") %>
<%
@ -3318,6 +3327,21 @@ fn static_assert() {
}
}
pub fn clone_${shorthand}_image(&self) -> longhands::${shorthand}_image::computed_value::T {
use values::None_;
longhands::${shorthand}_image::computed_value::T(
self.gecko.${image_layers_field}.mLayers.iter()
.take(self.gecko.${image_layers_field}.mImageCount as usize)
.map(|ref layer| {
match unsafe { layer.mImage.into_image() } {
Some(image) => Either::Second(image),
None => Either::First(None_),
}
}).collect()
)
}
<%
fill_fields = "mRepeat mClip mOrigin mPositionX mPositionY mImage mSize"
if shorthand == "background":

View file

@ -414,7 +414,12 @@ impl AnimatedProperty {
let value: longhands::${prop.ident}::computed_value::T =
ToAnimatedValue::from_animated_value(value);
% endif
style.mutate_${prop.style_struct.ident.strip("_")}().set_${prop.ident}(value);
<% method = "style.mutate_" + prop.style_struct.ident.strip("_") + "().set_" + prop.ident %>
% if prop.has_uncacheable_values is "True":
${method}(value, &mut false);
% else:
${method}(value);
% endif
}
% endif
% endfor

View file

@ -19,7 +19,7 @@ ${helpers.predefined_type("background-image", "ImageLayer",
initial_specified_value="Either::First(None_)",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector="True",
animation_value_type="none",
animation_value_type="discrete",
has_uncacheable_values="True" if product == "gecko" else "False",
ignored_when_colors_disabled="True")}

View file

@ -200,7 +200,7 @@ ${helpers.predefined_type("border-image-source", "ImageLayer",
initial_specified_value="Either::First(None_)",
spec="https://drafts.csswg.org/css-backgrounds/#the-background-image",
vector=False,
animation_value_type="none",
animation_value_type="discrete",
has_uncacheable_values=False,
boxed="True")}

View file

@ -150,6 +150,6 @@ ${helpers.predefined_type("mask-image", "ImageLayer",
vector=True,
products="gecko",
extra_prefixes="webkit",
animation_value_type="none",
animation_value_type="discrete",
flags="CREATES_STACKING_CONTEXT",
has_uncacheable_values="True" if product == "gecko" else "False")}