Tests/LibWeb: Add test for MouseEvent and WheelEvent bubbling

This commit is contained in:
circl 2024-07-16 16:18:26 +02:00 committed by Alexander Kalenik
parent f20010c1d3
commit 89531fb115
Notes: sideshowbarker 2024-07-17 07:14:26 +09:00
4 changed files with 50 additions and 0 deletions

View File

@ -0,0 +1 @@
PASS (did not hang)

View File

@ -0,0 +1 @@
PASS (did not hang)

View File

@ -0,0 +1,24 @@
<script src="../include.js"></script>
<style>
* { border: 1px solid black; }
.inner { width: 100px; height: 100px; }
</style>
<div class="outer"><div class="inner">
<script>
asyncTest(done => {
let eventCount = 0;
function clickHandler() {
eventCount++;
if (eventCount == 2) {
println('PASS (did not hang)');
done();
}
}
document.querySelector('.outer').addEventListener('click', clickHandler);
document.querySelector('.inner').addEventListener('click', clickHandler);
internals.click(50, 50);
});
</script>

View File

@ -0,0 +1,24 @@
<script src="../include.js"></script>
<style>
* { border: 1px solid black; }
.inner { width: 100px; height: 100px; }
</style>
<div class="outer"><div class="inner">
<script>
asyncTest(done => {
let eventCount = 0;
function wheelHandler() {
eventCount++;
if (eventCount == 2) {
println('PASS (did not hang)');
done();
}
}
document.querySelector('.outer').addEventListener('wheel', wheelHandler);
document.querySelector('.inner').addEventListener('wheel', wheelHandler);
internals.wheel(50, 50, 10, 0);
});
</script>