Commit 035ad13c authored by Dave Tapuska's avatar Dave Tapuska Committed by Commit Bot

Make type required for legacy init methods for UIEvents.

The KeyboardEvent was done with issue 692703 a few years ago and
encountered no issues.

This matches Gecko's definition.

Upon analysis of httparchive data. (Feb 01 2020 desktop data).

initUIEvent
6455 - Total
3765 - Flowplayer OK
253 - Photoswipe - OK
172 - Autoptimize - (contains flowplayer) - OK
121 - Mjl.js - OK
158 - doofinder - OK
178 - Ink.min.js - OK
122 - oxWbTabs - OK

initCompositionEvent
- No real usage I could detect. Queries returned _initCompositionEvent
which is defined for a JS editor.

initMouseEvent
1196 - total
839 - funcript - OK
121 - mjl.js - OK
19 - webcomponents - polymer used a version of it - OK
8 - au/event.js - yahoo - was comment only - OK

BUG=692720

Change-Id: I5a5a5a9ca8cbdb97b9f7c42ee545b73ee17fe3aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109818Reviewed-by: default avatarPhilip Jägenstedt <foolip@chromium.org>
Commit-Queue: Dave Tapuska <dtapuska@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753285}
parent cb4cc84f
......@@ -32,9 +32,7 @@
readonly attribute DOMString data;
// https://w3c.github.io/uievents/#idl-interface-CompositionEvent-initializers
// TODO(foolip): None of the initCompositionEvent() arguments should be
// optional, and the spec has a locale argument after data.
[Measure] void initCompositionEvent(optional DOMString type = "undefined",
[Measure] void initCompositionEvent(DOMString type,
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
......
......@@ -37,8 +37,7 @@
boolean getModifierState(DOMString keyArg);
// https://w3c.github.io/uievents/#idl-interface-MouseEvent-initializers
// TODO(foolip): None of the initMouseEvent() arguments should be optional.
[CallWith=ScriptState, Measure] void initMouseEvent(optional DOMString type = "undefined",
[CallWith=ScriptState, Measure] void initMouseEvent(DOMString type,
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
......
......@@ -28,8 +28,7 @@
readonly attribute InputDeviceCapabilities? sourceCapabilities;
// https://w3c.github.io/uievents/#idl-interface-UIEvent-initializers
// TODO(foolip): None of the initUIEvent() arguments should be optional.
[Measure] void initUIEvent(optional DOMString type = "undefined",
[Measure] void initUIEvent(DOMString type,
optional boolean bubbles = false,
optional boolean cancelable = false,
optional Window? view = null,
......
This is a testharness.js-based test.
FAIL Call initUIEvent without parameters assert_throws_js: function "function() { eventType.prototype[initFunction].call(event) }" did not throw
FAIL Call initMouseEvent without parameters assert_throws_js: function "function() { eventType.prototype[initFunction].call(event) }" did not throw
PASS Call initKeyboardEvent without parameters
FAIL Call initCompositionEvent without parameters assert_throws_js: function "function() { eventType.prototype[initFunction].call(event) }" did not throw
Harness: the test ran to completion.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment