mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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. Fixes #13529. Fixed #13298.
This commit is contained in:
parent
f7875dad1a
commit
ef82d772c1
15 changed files with 436 additions and 163 deletions
|
@ -270,34 +270,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