mirror of
https://github.com/servo/servo.git
synced 2025-08-06 06:00:15 +01:00
Call UpdateAnimations even if the element has no computed values.
This commit is contained in:
parent
c32ba98031
commit
f2c547aaaf
2 changed files with 10 additions and 4 deletions
|
@ -511,8 +511,14 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
fn update_animations(&self, pseudo: Option<&PseudoElement>) {
|
||||
let atom_ptr = PseudoElement::ns_atom_or_null_from_opt(pseudo);
|
||||
|
||||
let computed_data = self.borrow_data().unwrap();
|
||||
let computed_values = computed_data.styles().primary.values();
|
||||
// We have to update animations even if the element has no computed style
|
||||
// since it means the element is in a display:none subtree, we should destroy
|
||||
// all CSS animations in display:none subtree.
|
||||
let computed_data = self.borrow_data();
|
||||
let computed_values = computed_data.as_ref().map(|d| d.styles().primary.values());
|
||||
let computed_values_opt = computed_values.map(|v|
|
||||
*HasArcFFI::arc_as_borrowed(v)
|
||||
);
|
||||
|
||||
let parent_element = self.parent_element();
|
||||
let parent_data = parent_element.as_ref().and_then(|e| e.borrow_data());
|
||||
|
@ -523,7 +529,7 @@ impl<'le> TElement for GeckoElement<'le> {
|
|||
|
||||
unsafe {
|
||||
Gecko_UpdateAnimations(self.0, atom_ptr,
|
||||
HasArcFFI::arc_as_borrowed(&computed_values),
|
||||
computed_values_opt,
|
||||
parent_values_opt);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -545,7 +545,7 @@ extern "C" {
|
|||
pub fn Gecko_UpdateAnimations(aElement: RawGeckoElementBorrowed,
|
||||
aPseudoTagOrNull: *mut nsIAtom,
|
||||
aComputedValues:
|
||||
ServoComputedValuesBorrowed,
|
||||
ServoComputedValuesBorrowedOrNull,
|
||||
aParentComputedValues:
|
||||
ServoComputedValuesBorrowedOrNull);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue