Bug 1822323 - Add ToggleEvent interface for Popover. r=emilio

An implementation for https://html.spec.whatwg.org/multipage/popover.html#the-toggleevent-interface

Differential Revision: https://phabricator.services.mozilla.com/D172584
This commit is contained in:
Ziran Sun 2023-03-14 16:52:36 +00:00
Родитель edb2deabbd
Коммит d5d3b87d4a
3 изменённых файлов: 23 добавлений и 111 удалений

Просмотреть файл

@ -0,0 +1,21 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/.
*
* The origin of this IDL file is
* https://html.spec.whatwg.org/multipage/popover.html#the-toggleevent-interface
*/
[Pref="dom.element.popover.enabled",
Exposed=Window]
interface ToggleEvent : Event {
constructor(DOMString type, optional ToggleEventInit eventInitDict = {});
readonly attribute DOMString oldState;
readonly attribute DOMString newState;
};
dictionary ToggleEventInit : EventInit {
DOMString oldState = "";
DOMString newState = "";
};

Просмотреть файл

@ -961,6 +961,7 @@ WEBIDL_FILES = [
"TextTrackList.webidl",
"TimeEvent.webidl",
"TimeRanges.webidl",
"ToggleEvent.webidl",
"Touch.webidl",
"TouchEvent.webidl",
"TouchList.webidl",
@ -1186,6 +1187,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
"TCPServerSocketEvent.webidl",
"TCPSocketErrorEvent.webidl",
"TCPSocketEvent.webidl",
"ToggleEvent.webidl",
"TrackEvent.webidl",
"UDPMessageEvent.webidl",
"UserProximityEvent.webidl",

Просмотреть файл

@ -1,111 +0,0 @@
[toggleevent-interface.html]
[the event is an instance of ToggleEvent]
expected: FAIL
[the event inherts from Event]
expected: FAIL
[Missing type argument]
expected: FAIL
[type argument is string]
expected: FAIL
[type argument is null]
expected: FAIL
[event type set to undefined]
expected: FAIL
[oldState has default value of empty string]
expected: FAIL
[oldState is readonly]
expected: FAIL
[newState has default value of empty string]
expected: FAIL
[newState is readonly]
expected: FAIL
[ToggleEventInit argument is null]
expected: FAIL
[ToggleEventInit argument is undefined]
expected: FAIL
[ToggleEventInit argument is empty dictionary]
expected: FAIL
[oldState set to 'sample']
expected: FAIL
[oldState set to undefined]
expected: FAIL
[oldState set to null]
expected: FAIL
[oldState set to false]
expected: FAIL
[oldState set to true]
expected: FAIL
[oldState set to a number]
expected: FAIL
[oldState set to [\]]
expected: FAIL
[oldState set to [1, 2, 3\]]
expected: FAIL
[oldState set to an object]
expected: FAIL
[oldState set to an object with a valueOf function]
expected: FAIL
[ToggleEventInit properties set value]
expected: FAIL
[ToggleEventInit properties set value 2]
expected: FAIL
[ToggleEventInit properties set value 3]
expected: FAIL
[ToggleEventInit properties set value 4]
expected: FAIL
[newState set to 'sample']
expected: FAIL
[newState set to undefined]
expected: FAIL
[newState set to null]
expected: FAIL
[newState set to false]
expected: FAIL
[newState set to true]
expected: FAIL
[newState set to a number]
expected: FAIL
[newState set to [\]]
expected: FAIL
[newState set to [1, 2, 3\]]
expected: FAIL
[newState set to an object]
expected: FAIL
[newState set to an object with a valueOf function]
expected: FAIL