mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 13:47:45 +00:00
LibWeb: Add MouseEvent JavaScript constructor
This commit is contained in:
parent
9aadc6c8c9
commit
e2bc606eeb
5 changed files with 33 additions and 1 deletions
|
@ -0,0 +1,4 @@
|
|||
1. 10
|
||||
2. true
|
||||
3. true
|
||||
4. true
|
22
Tests/LibWeb/Text/input/UIEvents/custom-mouse-event.html
Normal file
22
Tests/LibWeb/Text/input/UIEvents/custom-mouse-event.html
Normal file
|
@ -0,0 +1,22 @@
|
|||
<script src="../include.js"></script>
|
||||
<script>
|
||||
test(() => {
|
||||
let testCounter = 1;
|
||||
function testPart(part) {
|
||||
println(`${testCounter}. ${JSON.stringify(part())}`);
|
||||
testCounter++;
|
||||
}
|
||||
|
||||
// 1. Creating a MouseEvent
|
||||
testPart(() => new MouseEvent('click', { clientX: 10 }).clientX);
|
||||
|
||||
// 2. Creating a MouseEvent with modifier
|
||||
testPart(() => new MouseEvent('click', { ctrlKey: true }).getModifierState('Control'));
|
||||
|
||||
// 3. Creating a MouseEvent with modifier
|
||||
testPart(() => new MouseEvent('click', { modifierAltGraph: true }).getModifierState('AltGraph'));
|
||||
|
||||
// 4. Creating a MouseEvent with modifier
|
||||
testPart(() => new MouseEvent('click', { modifierSymbolLock: true }).getModifierState('SymbolLock'));
|
||||
});
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue