Auto merge of #17866 - hiikezoe:restyle-damage, r=emilio

Preserve restyle damage if the element was not restyled during thrott…

…led animation flush.

<!-- Please describe your changes on the following line: -->
https://bugzilla.mozilla.org/show_bug.cgi?id=1381420

---
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors

<!-- 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/17866)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-07-25 20:19:16 -07:00 committed by GitHub
commit 40eeee4e05

View file

@ -2779,8 +2779,13 @@ pub extern "C" fn Servo_TakeChangeHint(element: RawGeckoElementBorrowed,
let damage = data.restyle.damage;
if restyle_behavior == structs::TraversalRestyleBehavior::ForThrottledAnimationFlush {
debug_assert!(data.restyle.is_restyle() || damage.is_empty(),
"Restyle damage should be empty if the element was not restyled");
if !*was_restyled {
// Don't touch elements if the element was not restyled
// in throttled animation flush.
debug!("Skip post traversal for throttled animation flush {:?} restyle={:?}",
element, data.restyle);
return nsChangeHint(0);
}
// In the case where we call this function for post traversal for
// flusing throttled animations (i.e. without normal restyle
// traversal), we need to preserve restyle hints for normal restyle