mirror of
https://github.com/servo/servo.git
synced 2025-06-25 01:24:37 +01:00
Allow that restyle hints other than animation hints remain for flushing throttle animations.
This commit is contained in:
parent
9c05481923
commit
f68bdb160f
1 changed files with 12 additions and 2 deletions
|
@ -2799,9 +2799,12 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
|
||||||
|
|
||||||
#[no_mangle]
|
#[no_mangle]
|
||||||
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||||
_raw_data: RawServoStyleSetBorrowed)
|
_raw_data: RawServoStyleSetBorrowed,
|
||||||
|
restyle_behavior: structs::TraversalRestyleBehavior)
|
||||||
-> ServoStyleContextStrong
|
-> ServoStyleContextStrong
|
||||||
{
|
{
|
||||||
|
use self::structs::TraversalRestyleBehavior as Restyle;
|
||||||
|
|
||||||
let element = GeckoElement(element);
|
let element = GeckoElement(element);
|
||||||
debug!("Servo_ResolveStyle: {:?}", element);
|
debug!("Servo_ResolveStyle: {:?}", element);
|
||||||
let data =
|
let data =
|
||||||
|
@ -2809,7 +2812,14 @@ pub extern "C" fn Servo_ResolveStyle(element: RawGeckoElementBorrowed,
|
||||||
|
|
||||||
// TODO(emilio): Downgrade to debug assertions when close to release.
|
// TODO(emilio): Downgrade to debug assertions when close to release.
|
||||||
assert!(data.has_styles(), "Resolving style on unstyled element");
|
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");
|
"Resolving style on element without current styles");
|
||||||
data.styles.primary().clone().into_strong()
|
data.styles.primary().clone().into_strong()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue