mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
Auto merge of #14084 - mrobinson:scroll_root_2, r=glennw
Don't promote all scrollable regions to stacking contexts <!-- Please describe your changes on the following line: --> Don't promote all scrollable regions to stacking contexts Instead annotate all flows with their owning ScrollRoots. When processing the display list items into a flattened display list, we add PushScrollRoot and PopScrollRoot to signal when scrolling regions start and end. It is possible for content from different scrolling regions to intersect and when they do, the stack of scrolling regions is duplicated. When these duplicated scrolling regions stacks reach WebRender, it will scroll them in tandem. The PushScrollRoot and PopScrollRoot items are currently represented as StackingContexts in WebRender, but eventually these will be replaced with special WebRender display items. --- <!-- 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 #13529 and #13298. (github issue number if applicable). <!-- Either: --> - [x] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- 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/14084) <!-- Reviewable:end -->
This commit is contained in:
commit
ef5ca14283
22 changed files with 454 additions and 181 deletions
|
@ -271,34 +271,34 @@ pub struct BuildDisplayList<'a> {
|
|||
impl<'a> BuildDisplayList<'a> {
|
||||
#[inline]
|
||||
pub fn traverse(&mut self, flow: &mut Flow) {
|
||||
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);
|
||||
}
|
||||
|
||||
if self.should_process() {
|
||||
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);
|
||||
|
||||
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) {
|
||||
self.traverse(kid);
|
||||
}
|
||||
|
||||
if new_stacking_context {
|
||||
self.state.pop_stacking_context_id();
|
||||
}
|
||||
|
||||
if new_scroll_root {
|
||||
self.state.pop_scroll_root_id();
|
||||
}
|
||||
}
|
||||
|
||||
#[inline]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue