mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:57:35 +00:00
LibWeb: Add internals.wheel() to simulate mouse wheel events
This function allows us to write tests for scrolling scenarios where the events are processed by the EventHandler.
This commit is contained in:
parent
e38ccebfc8
commit
40246adfb9
5 changed files with 48 additions and 0 deletions
|
@ -0,0 +1,12 @@
|
|||
<!DOCTYPE html>
|
||||
<style>
|
||||
.item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<div class="item">2</div>
|
||||
<div class="item">3</div>
|
||||
<div class="item">4</div>
|
28
Tests/LibWeb/Ref/scroll-using-mousewheel-event.html
Normal file
28
Tests/LibWeb/Ref/scroll-using-mousewheel-event.html
Normal file
|
@ -0,0 +1,28 @@
|
|||
<!DOCTYPE html>
|
||||
<link rel="match" href="reference/scroll-using-mousewheel-event-ref.html" />
|
||||
<style>
|
||||
.scrollable {
|
||||
overflow-y: scroll;
|
||||
width: 100px;
|
||||
height: 300px;
|
||||
}
|
||||
|
||||
.item {
|
||||
width: 100px;
|
||||
height: 100px;
|
||||
box-sizing: border-box;
|
||||
border: 1px solid black;
|
||||
}
|
||||
</style>
|
||||
<div class="scrollable">
|
||||
<div class="item">1</div>
|
||||
<div class="item">2</div>
|
||||
<div class="item">3</div>
|
||||
<div class="item">4</div>
|
||||
<div class="item">5</div>
|
||||
<div class="item">6</div>
|
||||
<div class="item">7</div>
|
||||
</div>
|
||||
<script>
|
||||
internals.wheel(10, 10, 0, 100);
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue