New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GamepadEvent constructor is missing the type argument #35
Comments
Yes, I noticed it as well when updating WebKit. Gecko / Blink and WebKit all take a type as first constructor parameter. |
eventInitDict should also be marked as optional. This matches both Firefox and Chrome's behavior. I will align WebKit accordingly. |
Per Web IDL: |
@toji, can you take a look at this? |
The PR looks good to me, but I think the GamepadEventInit param need not be optional unless we also change the gamepad member to optional. |
Good point about making the gamepad dictionary member optional. That said, Firefox and Chrome have the GamepadEventInit parameter as optional. The following WPT relies on it being optional too: I made it optional yesterday in WebKit to align with Firefox and Chrome. As such, I would suggest updating the spec to match browsers? |
Ah, another of these cases where the dictionary member being optional makes the corresponding interface attribute nullable be necessity. There's a TODO around this in Blink pointing to https://crbug.com/647693 and this very issue. Making it nullable+optional would make sense given that it already effectively is all implementations it seems. |
Yes, I confirmed it is nullable in WebKit as well:
|
@foolip Should GamepadEventInit be made optional too? This is still unresolved (web-platform-tests/wpt#14357). @ylafon, please reopen to address this issue. |
@ddorwin, it should be optional if there are no required members, and otherwise non-optional. |
(This is just generally how dictionary arguments are handled made optional or not depending on dictionary members, not something special about this case.) |
And default values in the dictionary, if possible 😊 general advice too. Feel free to tag me for review. |
https://w3c.github.io/gamepad/#gamepadevent-interface
A type argument needs to precede the dictionary.
[SameObject]
would be nice too, so:The text was updated successfully, but these errors were encountered: