aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHiroyuki Ikezoe <hikezoe@mozilla.com>2017-07-18 19:15:09 +0900
committerHiroyuki Ikezoe <hikezoe@mozilla.com>2017-07-18 19:15:11 +0900
commitf68bdb160f20505d96d3bb4baf40d47d453c3644 (patch)
tree8aa27a3d5698b405d2e19802ddd6a1d5ef435198
parent9c054819233e53cc21fab68bbf7b6a8128d886ac (diff)
downloadservo-f68bdb160f20505d96d3bb4baf40d47d453c3644.tar.gz
servo-f68bdb160f20505d96d3bb4baf40d47d453c3644.zip
Allow that restyle hints other than animation hints remain for flushing throttle animations.
-rw-r--r--ports/geckolib/glue.rs14
1 files changed, 12 insertions, 2 deletions
diff --git a/ports/geckolib/glue.rs b/ports/geckolib/glue.rs
index abfd5abe508..f69f77898b2 100644
--- a/ports/geckolib/glue.rs
+++ b/ports/geckolib/glue.rs
@@ -2799,9 +2799,12 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
#[no_mangle]
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
- _raw_data: RawServoStyleSetBorrowed)
+ _raw_data: RawServoStyleSetBorrowed,
+ restyle_behavior: structs::TraversalRestyleBehavior)
-> ServoStyleContextStrong
{
+ use self::structs::TraversalRestyleBehavior as Restyle;
+
let element = GeckoElement(element);
debug!("Servo_ResolveStyle: {:?}", element);
let data =
@@ -2809,7 +2812,14 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
// TODO(emilio): Downgrade to debug assertions when close to release.
assert!(data.has_styles(), "Resolving style on unstyled element");
- debug_assert!(element.has_current_styles(&*data),
+ // In the case where we process for throttled animation, there remaings
+ // restyle hints other than animation hints.
+ let flags = if restyle_behavior == Restyle::ForThrottledAnimationFlush {
+ ANIMATION_ONLY
+ } else {
+ TraversalFlags::empty()
+ };
+ debug_assert!(element.has_current_styles_for_traversal(&*data, flags),
"Resolving style on element without current styles");
data.styles.primary().clone().into_strong()
}