The following evaluates to true in WebKit Nightly, and to false in Chrome, Firefox, and Edge: 'keyCode' in UIEvent.prototype && 'charCode' in UIEvent.prototype Per the UI Events spec, keyCode and charCode should be properties of KeyboardEvent, not of UIEvent. See: * https://w3c.github.io/uievents/#interface-uievent * https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent
keyCode and charCode were present on UIEvent from long ago in the codebase. KeyboardEvent has them in the IDL, but hidden from JavaScript, oddly. Neither match the spec[1], which has: readonly attribute DOMString key; readonly attribute DOMString code; [1] https://w3c.github.io/uievents/#events-keyboardevents
To clarify, I'm referring to the legacy[1] KeyboardEvent.keyCode and KeyboardEvent.charCode properties: partial interface KeyboardEvent { // The following support legacy user agents readonly attribute unsigned long charCode; readonly attribute unsigned long keyCode; which are distinct from the modern[2] KeyboardEvent.key and KeyboardEvent.code properties. [1]: https://w3c.github.io/uievents/#legacy-interface-KeyboardEvent [2]: https://w3c.github.io/uievents/#events-keyboardevents
Mass move bugs into the DOM component.
This was fixed by r209895.