w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 52 forks source link

Specify the arguments of initMouseEvent() #136

Open foolip opened 7 years ago

foolip commented 7 years ago

https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers

Combining Blink and Gecko's IDL would give us something like this:

void initMouseEvent(DOMString type,
                    optional boolean bubbles = false,
                    optional boolean cancelable = false,
                    optional Window? view = null,
                    optional long detail = 0,
                    optional long screenX = 0,
                    optional long screenY = 0,
                    optional long clientX = 0,
                    optional long clientY = 0,
                    optional boolean ctrlKey = false,
                    optional boolean altKey = false,
                    optional boolean shiftKey = false,
                    optional boolean metaKey = false,
                    optional short button = 0,
                    optional EventTarget? relatedTarget = null);

(It would also be good to spell out that removal is not on the table. HTML calls such things obsolete instead of deprecated, which is more in line with how deprecation is used in at least Blink.)

Similar to https://github.com/w3c/uievents/issues/133 and https://github.com/w3c/uievents/issues/134. See also https://github.com/whatwg/dom/issues/387.

domenic commented 1 year ago

Note that https://drafts.csswg.org/cssom-view/#extensions-to-the-mouseevent-interface redefines {screen,client}{X,Y} as doubles, not longs, so maybe they should be changed in this method too?