Bug 1518442 - Part 1: Implement FormDataEvent interface; r=smaug,edgar

Differential Revision: https://phabricator.services.mozilla.com/D43985

--HG--
extra : moz-landing-system : lando
This commit is contained in:
John Dai 2019-09-06 20:50:43 +00:00
Родитель e069b70a33
Коммит c01608b314
8 изменённых файлов: 33 добавлений и 0 удалений

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

@ -177,6 +177,7 @@ EVENT(durationchange, eDurationChange, EventNameType_HTML, eBasicEventClass)
EVENT(emptied, eEmptied, EventNameType_HTML, eBasicEventClass)
EVENT(ended, eEnded, EventNameType_HTML, eBasicEventClass)
EVENT(finish, eMarqueeFinish, EventNameType_HTMLMarqueeOnly, eBasicEventClass)
EVENT(formdata, eFormData, EventNameType_HTML, eBasicEventClass)
EVENT(fullscreenchange, eFullscreenChange, EventNameType_HTML, eBasicEventClass)
EVENT(fullscreenerror, eFullscreenError, EventNameType_HTML, eBasicEventClass)
EVENT(input, eEditorInput, EventNameType_HTMLXUL, eEditorInputEventClass)

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

@ -130,6 +130,12 @@ const kEventConstructors = {
return new FontFaceSetLoadEvent(aName, aProps);
},
},
FormDataEvent: { create (aName, aProps) {
return new FormDataEvent(aName, {
formData: new FormData()
});
},
},
GamepadEvent: { create (aName, aProps) {
return new GamepadEvent(aName, aProps);
},

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

@ -384,6 +384,8 @@ var interfaceNamesInGlobalScope = [
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "FormData", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "FormDataEvent", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "FontFace", insecureContext: true },
// IMPORTANT: Do not change this list without review from a DOM peer!
{ name: "FontFaceSet", insecureContext: true },

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

@ -50,6 +50,7 @@ interface mixin GlobalEventHandlers {
attribute EventHandler ondurationchange;
attribute EventHandler onemptied;
attribute EventHandler onended;
attribute EventHandler onformdata;
attribute EventHandler oninput;
attribute EventHandler oninvalid;
attribute EventHandler onkeydown;

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

@ -0,0 +1,20 @@
/* -*- 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/form-control-infrastructure.html#the-formdataevent-interface
*/
[Exposed=Window,
Constructor(DOMString type, optional FormDataEventInit eventInitDict = {})]
interface FormDataEvent : Event {
// C++ can't deal with a method called FormData() in the generated code
[BinaryName="GetFormData"]
readonly attribute FormData formData;
};
dictionary FormDataEventInit : EventInit {
required FormData formData;
};

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

@ -1043,6 +1043,7 @@ GENERATED_EVENTS_WEBIDL_FILES = [
'DeviceProximityEvent.webidl',
'ErrorEvent.webidl',
'FontFaceSetLoadEvent.webidl',
'FormDataEvent.webidl',
'FrameCrashedEvent.webidl',
'GamepadAxisMoveEvent.webidl',
'GamepadButtonEvent.webidl',

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

@ -130,6 +130,7 @@ NS_EVENT_MESSAGE(eFormSelect)
NS_EVENT_MESSAGE(eFormInvalid)
NS_EVENT_MESSAGE(eFormCheckboxStateChange)
NS_EVENT_MESSAGE(eFormRadioStateChange)
NS_EVENT_MESSAGE(eFormData)
// Need separate focus/blur notifications for non-native widgets
NS_EVENT_MESSAGE(eFocus)

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

@ -2015,6 +2015,7 @@ STATIC_ATOMS = [
Atom("ontimeout", "ontimeout"),
Atom("ontimeupdate", "ontimeupdate"),
Atom("onended", "onended"),
Atom("onformdata", "onformdata"),
Atom("onratechange", "onratechange"),
Atom("ondurationchange", "ondurationchange"),
Atom("onvolumechange", "onvolumechange"),