mirror of
https://github.com/servo/servo.git
synced 2025-07-16 03:43:38 +01:00
Auto merge of #19016 - emilio:animation-avoid-flush-not-quite, r=hiro
style: Fix detection of animations to avoid style flushing in getComputedStyle. This fixes multiple things: * EffectCompositor was using the light tree instead of the flat tree. * When we insert an element inside the document, we may not style it right away (we mark it for lazy frame construction with the NODE_NEEDS_FRAME). Since we trigger animations and transitions from the traversal, we can't skip flushing if we call getComputedStyle on any of those. Bug: 1406750 Reviewed-by: hiro MozReview-Commit-ID: DpAhmLH3uJ2 <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/19016) <!-- Reviewable:end -->
This commit is contained in:
commit
6035b75d39
1 changed files with 12 additions and 0 deletions
|
@ -4395,11 +4395,23 @@ pub extern "C" fn Servo_ProcessInvalidations(
|
|||
pub extern "C" fn Servo_HasPendingRestyleAncestor(element: RawGeckoElementBorrowed) -> bool {
|
||||
let mut element = Some(GeckoElement(element));
|
||||
while let Some(e) = element {
|
||||
if e.has_animations() {
|
||||
return true;
|
||||
}
|
||||
|
||||
// If the element needs a frame, it means that we haven't styled it yet
|
||||
// after it got inserted in the document, and thus we may need to do
|
||||
// that for transitions and animations to trigger.
|
||||
if e.needs_frame() {
|
||||
return true;
|
||||
}
|
||||
|
||||
if let Some(data) = e.borrow_data() {
|
||||
if !data.hint.is_empty() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
element = e.traversal_parent();
|
||||
}
|
||||
false
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue