ladybird/Libraries/LibWeb/UIEvents/MouseEvent.idl
Andreas Kling 3e8c8b185e LibWeb: Use WindowProxy instead of Window in UI Events IDL
I believe this is an error in the UI Events spec, and it should be
updated to match the HTML spec (which uses WindowProxy everywhere).

This fixes a bunch of issues already covered by existing WPT tests.

Spec bug: https://github.com/w3c/uievents/issues/388

Note that WebKit has been using WindowProxy instead of Window in
UI Events IDL since 2018:
816158b4aa
2024-11-17 23:47:24 +01:00

55 lines
2.3 KiB
Text

#import <UIEvents/EventModifier.idl>
// https://w3c.github.io/uievents/#mouseevent
[Exposed=Window]
interface MouseEvent : UIEvent {
constructor(DOMString type, optional MouseEventInit eventInitDict = {});
// https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
readonly attribute double screenX;
readonly attribute double screenY;
readonly attribute double pageX;
readonly attribute double pageY;
readonly attribute double clientX;
readonly attribute double clientY;
readonly attribute double x;
readonly attribute double y;
readonly attribute double offsetX;
readonly attribute double offsetY;
readonly attribute boolean ctrlKey;
readonly attribute boolean shiftKey;
readonly attribute boolean altKey;
readonly attribute boolean metaKey;
// https://w3c.github.io/pointerlock/#extensions-to-the-mouseevent-interface
readonly attribute double movementX;
readonly attribute double movementY;
readonly attribute short button;
readonly attribute unsigned short buttons;
readonly attribute EventTarget? relatedTarget;
boolean getModifierState(DOMString keyArg);
// https://w3c.github.io/uievents/#dom-mouseevent-initmouseevent
undefined initMouseEvent(DOMString typeArg, optional boolean bubblesArg = false, optional boolean cancelableArg = false, optional WindowProxy? viewArg = null, optional long detailArg = 0, optional long screenXArg = 0, optional long screenYArg = 0, optional long clientXArg = 0, optional long clientYArg = 0, optional boolean ctrlKeyArg = false, optional boolean altKeyArg = false, optional boolean shiftKeyArg = false, optional boolean metaKeyArg = false, optional short buttonArg = 0, optional EventTarget? relatedTargetArg = null);
};
// https://w3c.github.io/uievents/#idl-mouseeventinit
dictionary MouseEventInit : EventModifierInit {
// https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface
double screenX = 0;
double screenY = 0;
double clientX = 0;
double clientY = 0;
// https://w3c.github.io/pointerlock/#extensions-to-the-mouseeventinit-dictionary
double movementX = 0;
double movementY = 0;
short button = 0;
unsigned short buttons = 0;
EventTarget? relatedTarget = null;
};