mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 1322938 - Emit close event when HTMLDialogElement.prototype.close() is called. r=smaug
MozReview-Commit-ID: 7OKlKFb3lok
This commit is contained in:
parent
53316683b8
commit
3a9c63ff99
@ -172,6 +172,10 @@ EVENT(click,
|
||||
eMouseClick,
|
||||
EventNameType_All,
|
||||
eMouseEventClass)
|
||||
EVENT(close,
|
||||
eClose,
|
||||
EventNameType_HTML,
|
||||
eBasicEventClass)
|
||||
EVENT(contextmenu,
|
||||
eContextMenu,
|
||||
EventNameType_HTMLXUL,
|
||||
@ -1090,4 +1094,3 @@ NON_IDL_EVENT(complete,
|
||||
#undef DOCUMENT_ONLY_EVENT
|
||||
#undef NON_IDL_EVENT
|
||||
#endif /* MESSAGE_TO_EVENT */
|
||||
|
||||
|
@ -30,6 +30,9 @@ HTMLDialogElement::Close(const mozilla::dom::Optional<nsAString>& aReturnValue)
|
||||
ErrorResult ignored;
|
||||
SetOpen(false, ignored);
|
||||
ignored.SuppressException();
|
||||
RefPtr<AsyncEventDispatcher> eventDispatcher =
|
||||
new AsyncEventDispatcher(this, NS_LITERAL_STRING("close"), false);
|
||||
eventDispatcher->PostDOMEvent();
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -7,6 +7,7 @@
|
||||
#ifndef HTMLDialogElement_h
|
||||
#define HTMLDialogElement_h
|
||||
|
||||
#include "mozilla/AsyncEventDispatcher.h"
|
||||
#include "mozilla/Attributes.h"
|
||||
#include "nsGenericHTMLElement.h"
|
||||
#include "nsGkAtoms.h"
|
||||
|
@ -38,7 +38,7 @@ interface GlobalEventHandlers {
|
||||
attribute EventHandler oncanplaythrough;
|
||||
attribute EventHandler onchange;
|
||||
attribute EventHandler onclick;
|
||||
//(Not implemented)attribute EventHandler onclose;
|
||||
attribute EventHandler onclose;
|
||||
attribute EventHandler oncontextmenu;
|
||||
//(Not implemented)attribute EventHandler oncuechange;
|
||||
attribute EventHandler ondblclick;
|
||||
|
@ -442,6 +442,9 @@ NS_EVENT_MESSAGE(eSelectionChange)
|
||||
// Details element events.
|
||||
NS_EVENT_MESSAGE(eToggle)
|
||||
|
||||
// Dialog element events.
|
||||
NS_EVENT_MESSAGE(eClose)
|
||||
|
||||
#ifdef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
|
||||
#undef UNDEF_NS_EVENT_MESSAGE_FIRST_LAST
|
||||
#undef NS_EVENT_MESSAGE_FIRST_LAST
|
||||
|
Loading…
Reference in New Issue
Block a user