aboutsummaryrefslogtreecommitdiffstats
path: root/components/layout/traversal.rs
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2016-10-31 20:24:27 +0100
committerMartin Robinson <mrobinson@igalia.com>2016-11-05 18:36:45 +0100
commitef82d772c19f797228d7ed2a9d8804f17588117c (patch)
tree920e575a8b2f638f05655171861f0730c8f385fe /components/layout/traversal.rs
parentf7875dad1a43792ff3869f292990d03d30ebd9eb (diff)
downloadservo-ef82d772c19f797228d7ed2a9d8804f17588117c.tar.gz
servo-ef82d772c19f797228d7ed2a9d8804f17588117c.zip
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.
Diffstat (limited to 'components/layout/traversal.rs')
-rw-r--r--components/layout/traversal.rs38
1 files changed, 19 insertions, 19 deletions
diff --git a/components/layout/traversal.rs b/components/layout/traversal.rs
index c897838875a..1792f1134ff 100644
--- a/components/layout/traversal.rs
+++ b/components/layout/traversal.rs
@@ -270,34 +270,34 @@ pub struct BuildDisplayList<'a> {
impl<'a> BuildDisplayList<'a> {
#[inline]
pub fn traverse(&mut self, flow: &mut Flow) {
- 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_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);
- }
+ 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() {
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]