Issue #2435 - Add onrejectionhandled and onunhandledrejection EventHandler

Based-on: m-c 1362272
This commit is contained in:
Martok 2024-01-02 02:10:31 +01:00 committed by roytam1
commit 65d72c5682
6 changed files with 14 additions and 4 deletions

View file

@ -908,6 +908,7 @@ GK_ATOM(onreadsuccess, "onreadsuccess")
GK_ATOM(onready, "onready")
GK_ATOM(onreadystatechange, "onreadystatechange")
GK_ATOM(onreceived, "onreceived")
GK_ATOM(onrejectionhandled, "onrejectionhandled")
GK_ATOM(onremoteheld, "onremoteheld")
GK_ATOM(onremoteresumed, "onremoteresumed")
GK_ATOM(onrequestprogress, "onrequestprogress")
@ -951,6 +952,7 @@ GK_ATOM(ontransitionend, "ontransitionend")
GK_ATOM(ontransitionrun, "ontransitionrun")
GK_ATOM(ontransitionstart, "ontransitionstart")
GK_ATOM(onunderflow, "onunderflow")
GK_ATOM(onunhandledrejection, "onunhandledrejection")
GK_ATOM(onunload, "onunload")
GK_ATOM(onupdatefound, "onupdatefound")
GK_ATOM(onupdateready, "onupdateready")

View file

@ -578,14 +578,14 @@ WINDOW_EVENT(popstate,
ePopState,
EventNameType_XUL | EventNameType_HTMLBodyOrFramesetOnly,
eBasicEventClass)
// Not supported yet
// WINDOW_EVENT(redo)
WINDOW_EVENT(rejectionhandled, eRejectionHandled,
EventNameType_HTMLBodyOrFramesetOnly, eBasicEventClass)
WINDOW_EVENT(storage,
eStorage,
EventNameType_HTMLBodyOrFramesetOnly,
eBasicEventClass)
// Not supported yet
// WINDOW_EVENT(undo)
WINDOW_EVENT(unhandledrejection, eUnhandledRejection,
EventNameType_HTMLBodyOrFramesetOnly, eBasicEventClass)
WINDOW_EVENT(unload,
eUnload,
(EventNameType_XUL | EventNameType_SVGSVG |

View file

@ -160,7 +160,9 @@ interface WindowEventHandlers {
attribute EventHandler onpagehide;
attribute EventHandler onpageshow;
attribute EventHandler onpopstate;
attribute EventHandler onrejectionhandled;
attribute EventHandler onstorage;
attribute EventHandler onunhandledrejection;
attribute EventHandler onunload;
};

View file

@ -25,6 +25,8 @@ interface WorkerGlobalScope : EventTarget {
attribute EventHandler onoffline;
attribute EventHandler ononline;
attribute EventHandler onrejectionhandled;
attribute EventHandler onunhandledrejection;
// also has additional members in a partial interface
};

View file

@ -151,6 +151,8 @@ public:
IMPL_EVENT_HANDLER(online)
IMPL_EVENT_HANDLER(offline)
IMPL_EVENT_HANDLER(rejectionhandled)
IMPL_EVENT_HANDLER(unhandledrejection)
void
Dump(const Optional<nsAString>& aString) const;

View file

@ -118,7 +118,9 @@ NS_EVENT_MESSAGE(eImageAbort)
NS_EVENT_MESSAGE(eLoadError)
NS_EVENT_MESSAGE(eLoadEnd)
NS_EVENT_MESSAGE(ePopState)
NS_EVENT_MESSAGE(eRejectionHandled)
NS_EVENT_MESSAGE(eStorage)
NS_EVENT_MESSAGE(eUnhandledRejection)
NS_EVENT_MESSAGE(eBeforeUnload)
NS_EVENT_MESSAGE(eReadyStateChange)