ladybird/Libraries/LibWeb/Gamepad/GamepadEvent.idl
Tim Ledbetter 9c204f36ec LibWeb: Make eventInitDict GamepadEvent constructor parameter optional
This differs from the specification but matches the behavior of
existing implementations.
2025-09-23 16:04:56 +01:00

18 lines
753 B
Text

#import <DOM/Event.idl>
#import <Gamepad/Gamepad.idl>
// https://w3c.github.io/gamepad/#dom-gamepadevent
[Exposed=Window]
interface GamepadEvent : Event {
// eventInitDict is not marked as optional in the specification, but existing implementations treat it as optional.
// See: https://github.com/w3c/gamepad/pull/217
constructor(DOMString type, optional GamepadEventInit eventInitDict = {});
[SameObject] readonly attribute Gamepad? gamepad;
};
// https://w3c.github.io/gamepad/#dom-gamepadeventinit
dictionary GamepadEventInit : EventInit {
// This is marked as required in the specification, but existing implementations treat it as optional.
// See: https://github.com/w3c/gamepad/pull/217
Gamepad? gamepad = null;
};