diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-26 07:28:23 +0530 |
---|---|---|
committer | bors-servo <lbergstrom+bors@mozilla.com> | 2016-01-26 07:28:23 +0530 |
commit | b66a0014510aaebb7c926160923738fc4fe88ca2 (patch) | |
tree | 22c0f0172ed53c4c674799438c261d462f936309 | |
parent | 71d49fc73dd0f3fe42757d87cb60b98c9454d5fa (diff) | |
parent | e4db0715e1c662be77f41fe960296ab723f33557 (diff) | |
download | servo-b66a0014510aaebb7c926160923738fc4fe88ca2.tar.gz servo-b66a0014510aaebb7c926160923738fc4fe88ca2.zip |
Auto merge of #9429 - pcwalton:iframe-scroll-stacking, r=mbrubeck
Dispatch scroll events to layers above others.
Closes #9416.
r? @mbrubeck
<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.svg" height="40" alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/9429)
<!-- Reviewable:end -->
-rw-r--r-- | components/compositing/compositor_layer.rs | 2 | ||||
-rw-r--r-- | tests/html/iframe-scroll-stacking.html | 27 |
2 files changed, 28 insertions, 1 deletions
diff --git a/components/compositing/compositor_layer.rs b/components/compositing/compositor_layer.rs index 9c7d567c43a..9e2b47a5c08 100644 --- a/components/compositing/compositor_layer.rs +++ b/components/compositing/compositor_layer.rs @@ -317,7 +317,7 @@ impl CompositorLayer for Layer<CompositorData> { // Allow children to scroll. let scroll_offset = self.extra_data.borrow().scroll_offset; let new_cursor = cursor - scroll_offset; - for child in &*self.children() { + for child in self.children().iter().rev() { let child_bounds = child.bounds.borrow(); if child_bounds.contains(&new_cursor) { let result = child.handle_scroll_event(delta, new_cursor - child_bounds.origin); diff --git a/tests/html/iframe-scroll-stacking.html b/tests/html/iframe-scroll-stacking.html new file mode 100644 index 00000000000..a554bede526 --- /dev/null +++ b/tests/html/iframe-scroll-stacking.html @@ -0,0 +1,27 @@ +<!DOCTYPE html> +<style> + body { + margin: 0; + } + + iframe { + display: block; + width: 300px; + height: 300px; + position: absolute; + background: white; + } + + .i1 { + top: 50px; + left: 50px; + } + + .i2 { + top: 100px; + left: 100px; + } +</style> + +<iframe class="i1" src="lipsum.html"></iframe> +<iframe class="i2" src="lipsum.html"></iframe> |