mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-02 14:19:48 +00:00
LibWeb: Skip page scrolling for wheel events consumed by scrollable box
Leftover from 90879a07ba
This commit is contained in:
parent
a386ebde02
commit
0afbd827e0
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/kalenikaliaksandr
Commit: 0afbd827e0
Pull-request: https://github.com/SerenityOS/serenity/pull/23614
3 changed files with 37 additions and 1 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
scrollable.scrollTop: 200
|
||||||
|
window.scrollY: 0
|
|
@ -0,0 +1,33 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
height: 2000px;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
#box {
|
||||||
|
margin-top: 500px;
|
||||||
|
width: 100px;
|
||||||
|
height: 100px;
|
||||||
|
background-color: red;
|
||||||
|
}
|
||||||
|
|
||||||
|
#scrollable {
|
||||||
|
width: 400px;
|
||||||
|
height: 400px;
|
||||||
|
overflow: scroll;
|
||||||
|
border: 10px solid black;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div id="scrollable">
|
||||||
|
<div id="box"></div>
|
||||||
|
</div>
|
||||||
|
<script src="include.js"></script>
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
internals.wheel(10, 10, 0, 1000);
|
||||||
|
const scrollable = document.getElementById("scrollable");
|
||||||
|
println("scrollable.scrollTop: " + scrollable.scrollTop);
|
||||||
|
println("window.scrollY: " + window.scrollY);
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -180,7 +180,8 @@ bool EventHandler::handle_mousewheel(CSSPixelPoint position, CSSPixelPoint scree
|
||||||
containing_block = containing_block->containing_block();
|
containing_block = containing_block->containing_block();
|
||||||
}
|
}
|
||||||
|
|
||||||
paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y);
|
if (paintable->handle_mousewheel({}, position, buttons, modifiers, wheel_delta_x, wheel_delta_y))
|
||||||
|
return true;
|
||||||
|
|
||||||
auto node = dom_node_for_event_dispatch(*paintable);
|
auto node = dom_node_for_event_dispatch(*paintable);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue