Auto merge of #18389 - legnaleurc:has_pending_restyle_ancestor, r=emilio

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 -->
This commit is contained in:
bors-servo 2017-09-06 10:47:32 -05:00 committed by GitHub
commit 00867711b3

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
}