Auto merge of #13957 - mrobinson:scroll_root, r=glennw

Track overflow:scroll stacking contexts with ScrollRootId instead of StackingContextId

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

---
<!-- 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
- [x] These changes do not require tests because this PR should not change behavior.

<!-- 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/13957)
<!-- Reviewable:end -->
This commit is contained in:
bors-servo 2016-10-30 15:27:56 -05:00 committed by GitHub
commit 3a3f3192a8
31 changed files with 540 additions and 301 deletions

View file

@ -264,10 +264,28 @@ impl<'a> BuildDisplayList<'a> {
#[inline]
pub fn traverse(&mut self, flow: &mut Flow) {
if self.should_process() {
self.state.push_stacking_context_id(flow::base(flow).stacking_context_id);
let new_stacking_context =
flow::base(flow).stacking_context_id != self.state.stacking_context_id();
if new_stacking_context {
self.state.push_stacking_context_id(flow::base(flow).stacking_context_id);
}
let new_scroll_root =
flow::base(flow).scroll_root_id != self.state.scroll_root_id();
if new_scroll_root {
self.state.push_scroll_root_id(flow::base(flow).scroll_root_id);
}
flow.build_display_list(&mut self.state);
flow::mut_base(flow).restyle_damage.remove(REPAINT);
self.state.pop_stacking_context_id();
if new_stacking_context {
self.state.pop_stacking_context_id();
}
if new_scroll_root {
self.state.pop_scroll_root_id();
}
}
for kid in flow::child_iter_mut(flow) {