mirror of
https://github.com/servo/servo.git
synced 2025-06-20 07:08:59 +01:00
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 -->
This commit is contained in:
commit
b66a001451
2 changed files with 28 additions and 1 deletions
|
@ -317,7 +317,7 @@ impl CompositorLayer for Layer<CompositorData> {
|
||||||
// Allow children to scroll.
|
// Allow children to scroll.
|
||||||
let scroll_offset = self.extra_data.borrow().scroll_offset;
|
let scroll_offset = self.extra_data.borrow().scroll_offset;
|
||||||
let new_cursor = cursor - 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();
|
let child_bounds = child.bounds.borrow();
|
||||||
if child_bounds.contains(&new_cursor) {
|
if child_bounds.contains(&new_cursor) {
|
||||||
let result = child.handle_scroll_event(delta, new_cursor - child_bounds.origin);
|
let result = child.handle_scroll_event(delta, new_cursor - child_bounds.origin);
|
||||||
|
|
27
tests/html/iframe-scroll-stacking.html
Normal file
27
tests/html/iframe-scroll-stacking.html
Normal file
|
@ -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>
|
Loading…
Add table
Add a link
Reference in a new issue