mirror of
https://github.com/servo/servo.git
synced 2025-08-03 12:40:06 +01:00
Update CustomEvent webidl interface (#33481)
The [idl interface](https://dom.spec.whatwg.org/#interface-customevent) and servo's implementation had diverged. * Extra arguments to initCustomEvent are optional (fixes `dom/events/CustomEvent.html`) * The CustomEvent constructor is infallible * "[Exposed=*]" (and the same for the "Event" interface since it's CustomEvent's parent.) Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
This commit is contained in:
parent
4c3b3529a8
commit
7cbc5f6ee6
6 changed files with 14 additions and 17 deletions
|
@ -13,12 +13,19 @@
|
|||
* http://www.openwebfoundation.org/legal/the-owf-1-0-agreements/owfa-1-0.
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
// https://dom.spec.whatwg.org/#dom-customevent-initcustomevent
|
||||
[Exposed=*]
|
||||
interface CustomEvent : Event {
|
||||
[Throws] constructor(DOMString type, optional CustomEventInit eventInitDict = {});
|
||||
constructor(DOMString type, optional CustomEventInit eventInitDict = {});
|
||||
|
||||
readonly attribute any detail;
|
||||
|
||||
undefined initCustomEvent(DOMString type, boolean bubbles, boolean cancelable, any detail);
|
||||
undefined initCustomEvent(
|
||||
DOMString type,
|
||||
optional boolean bubbles = false,
|
||||
optional boolean cancelable = false,
|
||||
optional any detail = null
|
||||
); // legacy
|
||||
};
|
||||
|
||||
dictionary CustomEventInit : EventInit {
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* https://dom.spec.whatwg.org/#event
|
||||
*/
|
||||
|
||||
[Exposed=(Window,Worker)]
|
||||
[Exposed=*]
|
||||
interface Event {
|
||||
[Throws] constructor(DOMString type, optional EventInit eventInitDict = {});
|
||||
[Pure]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue