aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Robinson <mrobinson@igalia.com>2014-09-23 16:53:50 -0700
committerMartin Robinson <mrobinson@igalia.com>2014-09-25 07:57:47 -0700
commit65c6689bccdbde22030764adb2b563fcb0f847ca (patch)
tree03e4d4e08cc886c143954f1e9e8d9faac3abd403
parentf346a215f330343620c3a57c1edf8f1f91330d12 (diff)
downloadservo-65c6689bccdbde22030764adb2b563fcb0f847ca.tar.gz
servo-65c6689bccdbde22030764adb2b563fcb0f847ca.zip
Compound scrolling offsets when setting content offset
When traversing the layer tree to assign content offset, the new offset needs to take into account any additional offset from children that are also scrolling roots. This means that when you scroll a parent frame, it doesn't override the scroll position of its children, but adds to it.
-rw-r--r--components/compositing/events.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/components/compositing/events.rs b/components/compositing/events.rs
index a6b36fa6df0..aa1bfc6e2a3 100644
--- a/components/compositing/events.rs
+++ b/components/compositing/events.rs
@@ -143,8 +143,9 @@ fn scroll_layer_and_all_child_layers(layer: Rc<Layer<CompositorData>>,
result = true
}
+ let offset_for_children = new_offset + layer.extra_data.borrow().scroll_offset;
for child in layer.children().iter() {
- result |= scroll_layer_and_all_child_layers(child.clone(), new_offset);
+ result |= scroll_layer_and_all_child_layers(child.clone(), offset_for_children);
}
return result;