Skip to content

Commit

Permalink
Auto merge of #18389 - legnaleurc:has_pending_restyle_ancestor, r=emilio
Browse files Browse the repository at this point in the history
Add a function to find out if a node has any ancestor that is pending for restyling.

Fixes [Bug 1397168](https://bugzil.la/1397168).

<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix [Bug 1397168](https://bugzil.la/1397168) (github issue number if applicable).

<!-- Either: -->
- [ ] There are tests for these changes OR
- [ ] These changes do not require tests because _____

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- 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/18389)
<!-- Reviewable:end -->
  • Loading branch information
bors-servo committed Sep 6, 2017
2 parents 4ada03f + ffa9ee3 commit 0086771
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions ports/geckolib/glue.rs
Expand Up @@ -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
}

0 comments on commit 0086771

Please sign in to comment.