From 40b0d525dd6fdd39602e7fa280837441d1f5d40f Mon Sep 17 00:00:00 2001 From: Hiroyuki Ikezoe Date: Wed, 26 Jul 2017 11:09:19 +0900 Subject: [PATCH] Preserve restyle damage if the element was not restyled during throttled animation flush. --- ports/geckolib/glue.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs index 670690a79df..580d2503113 100644 --- a/ports/geckolib/glue.rs +++ b/ports/geckolib/glue.rs @@ -2779,8 +2779,13 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed, let damage = data.restyle.damage; if restyle_behavior == structs::TraversalRestyleBehavior::ForThrottledAnimationFlush { - debug_assert!(data.restyle.is_restyle() || damage.is_empty(), - "Restyle damage should be empty if the element was not restyled"); + if !*was_restyled { + // Don't touch elements if the element was not restyled + // in throttled animation flush. + debug!("Skip post traversal for throttled animation flush {:?} restyle={:?}", + element, data.restyle); + return nsChangeHint(0); + } // In the case where we call this function for post traversal for // flusing throttled animations (i.e. without normal restyle // traversal), we need to preserve restyle hints for normal restyle