Skip to content

Conversation

nondebug
Copy link
Collaborator

@nondebug nondebug commented Oct 10, 2024

Closes #216

The following tasks have been completed:

  • Modified Web platform tests (link to pull request)

Implementation commitment:


Preview | Diff


interface GamepadEvent: Event {
constructor(DOMString type, GamepadEventInit eventInitDict);
constructor(DOMString type, optional GamepadEventInit eventInitDict = {});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably need to remove the required from GamepadEventInit's gamepad.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blink, Gecko, WebKit agree that GamepadEventInit's gamepad attribute is optional and nullable, let's update the spec to match.

  Gamepad? gamepad;  // blink
  Gamepad? gamepad = null;  // Gecko
  Gamepad? gamepad = null;  // WebKit

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good.

@tcl3
Copy link

tcl3 commented Sep 2, 2025

Should the type of the gamepad attribute also be nullable, since it can now return null?

@marcoscaceres
Copy link
Member

@tcl3, yes, good catch. I think the attributes are required to mirror the value they are initialized with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eventInitDict parameter in GamepadEvent constructor should be optional

3 participants