Skip to content
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

Clearly specify initUIEvent #133

Open
dtapuska opened this issue Feb 21, 2017 · 5 comments
Open

Clearly specify initUIEvent #133

dtapuska opened this issue Feb 21, 2017 · 5 comments

Comments

@dtapuska
Copy link
Contributor

Since initUIEvent probably isn't going away anytime soon. It should be clearly documented with respect to its arguments instead of its current specification of no arguments.

It is present in multiple browsers according to MDN; https://developer.mozilla.org/en-US/docs/Web/API/UIEvent/initUIEvent

We need to decide what the actual specified behavior is:

Chromium has this:
void initUIEvent([Default=Undefined] optional DOMString type,
[Default=Undefined] optional boolean bubbles,
[Default=Undefined] optional boolean cancelable,
[Default=Undefined] optional Window? view,
[Default=Undefined] optional long detail);

But it identifies that all the values should not be optional. We need to figure out what other vendors have.

@garykac @foolip @smaug----

@foolip
Copy link
Member

foolip commented Feb 21, 2017

In this issue I would include all the init*Event methods in the spec, especially initMouseEvent and initKeyboardEvent. Even if the arguments differ in different implementations, there's probably some number of leading arguments that would be enough to support.

@foolip
Copy link
Member

foolip commented Feb 21, 2017

@smaug----
Copy link

How does chromium handle those undefined values? Does undefined boolean end up treated as false?

@foolip
Copy link
Member

foolip commented Feb 23, 2017

Yes, Chromium's IDL is effectively this:

void initUIEvent(optional DOMString type = "",
                 optional boolean bubbles = false,
                 optional boolean cancelable = false,
                 optional Window? view = null,
                 optional long detail = 0);

As in whatwg/dom#387, I think we should make the first argument non-optional and make the rest optional with defaults.

@annevk
Copy link
Member

annevk commented Mar 23, 2018

Yes, this should be aligned with DOM.

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

No branches or pull requests

5 participants