Drop AnimatedProperty for stylo.

set_list_style_type() for gecko needs an additional argument 'Device' [1], and
making list-style-type animtable makes AnimatedProperty::update() call the
set_list_style_type(). To avoid introducing the Device argument to the setter in
servo, this patch makes simply PropertyAnimation conditional build.
(Whereas in stylo, we don't use the setter for animation, we use clone_xx()
instead.)

[1] https://hg.mozilla.org/mozilla-central/file/1d042bcb2632/servo/components/style/properties/properties.mako.rs#l2667
This commit is contained in:
Hiroyuki Ikezoe 2017-08-09 16:25:08 +09:00
parent 89971910cf
commit 17eba0d4d6
3 changed files with 16 additions and 2 deletions

View file

@ -5,7 +5,7 @@
//! The context within which style is calculated.
#[cfg(feature = "servo")] use animation::Animation;
use animation::PropertyAnimation;
#[cfg(feature = "servo")] use animation::PropertyAnimation;
use app_units::Au;
use bloom::StyleBloom;
use cache::LRUCache;
@ -293,6 +293,7 @@ pub struct CurrentElementInfo {
is_initial_style: bool,
/// A Vec of possibly expired animations. Used only by Servo.
#[allow(dead_code)]
#[cfg(feature = "servo")]
pub possibly_expired_animations: Vec<PropertyAnimation>,
}
@ -668,6 +669,17 @@ impl<E: TElement> ThreadLocalStyleContext<E> {
}
}
#[cfg(feature = "gecko")]
/// Notes when the style system starts traversing an element.
pub fn begin_element(&mut self, element: E, data: &ElementData) {
debug_assert!(self.current_element_info.is_none());
self.current_element_info = Some(CurrentElementInfo {
element: element.as_node().opaque(),
is_initial_style: !data.has_styles(),
});
}
#[cfg(feature = "servo")]
/// Notes when the style system starts traversing an element.
pub fn begin_element(&mut self, element: E, data: &ElementData) {
debug_assert!(self.current_element_info.is_none());