Add a function to find out if a node has any ancestor that is pending for restyling.

This commit is contained in:
Wei-Cheng Pan 2017-09-06 15:40:54 +08:00
parent 6051e5ed02
commit ffa9ee3f61

View file

@ -3783,3 +3783,17 @@ pub extern "C" fn Servo_ProcessInvalidations(set: RawServoStyleSetBorrowed,
}
}
}
#[no_mangle]
pub extern "C" fn Servo_HasPendingRestyleAncestor(element: RawGeckoElementBorrowed) -> bool {
let mut element = Some(GeckoElement(element));
while let Some(e) = element {
if let Some(data) = e.borrow_data() {
if data.restyle.hint.has_non_animation_invalidations() {
return true;
}
}
element = e.traversal_parent();
}
false
}