Auto merge of #18271 - legnaleurc:propagate_dirty_bits, r=emilio

Propagate dirty bits after invalidation if needed.

<!-- Please describe your changes on the following line: -->

Follow up for [bug 1388298](https://bugzil.la/1388298).

---
<!-- 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
- [ ] These changes fix #__ (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/18271)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2017-09-05 14:18:52 -05:00 committed by GitHub
commit 122e49d516
3 changed files with 73 additions and 20 deletions

View file

@ -3745,6 +3745,17 @@ pub extern "C" fn Servo_ProcessInvalidations(set: RawServoStyleSetBorrowed,
let mut data = data.as_mut().map(|d| &mut **d);
if let Some(ref mut data) = data {
data.invalidate_style_if_needed(element, &shared_style_context, None);
let result = data.invalidate_style_if_needed(element, &shared_style_context, None);
if result.has_invalidated_siblings() {
let parent = element.traversal_parent().expect("How could we invalidate siblings without a common parent?");
unsafe {
parent.set_dirty_descendants();
bindings::Gecko_NoteDirtySubtreeForInvalidation(parent.0);
}
} else if result.has_invalidated_descendants() {
unsafe { bindings::Gecko_NoteDirtySubtreeForInvalidation(element.0) };
} else if result.has_invalidated_self() {
unsafe { bindings::Gecko_NoteDirtyElement(element.0) };
}
}
}