From ef2cd8749ff41c3d87a19b598d8d3be1430b75bf Mon Sep 17 00:00:00 2001 From: Gaming4JC Date: Tue, 7 Jan 2020 08:27:34 -0500 Subject: Bug 1322938 - Emit close event when HTMLDialogElement.prototype.close() is called. Tag #1343 --- dom/html/HTMLDialogElement.cpp | 3 +++ dom/html/HTMLDialogElement.h | 1 + 2 files changed, 4 insertions(+) (limited to 'dom/html') diff --git a/dom/html/HTMLDialogElement.cpp b/dom/html/HTMLDialogElement.cpp index 1f796f9a6..1f65b602f 100644 --- a/dom/html/HTMLDialogElement.cpp +++ b/dom/html/HTMLDialogElement.cpp @@ -30,6 +30,9 @@ HTMLDialogElement::Close(const mozilla::dom::Optional& aReturnValue) ErrorResult ignored; SetOpen(false, ignored); ignored.SuppressException(); + RefPtr eventDispatcher = + new AsyncEventDispatcher(this, NS_LITERAL_STRING("close"), false); + eventDispatcher->PostDOMEvent(); } void diff --git a/dom/html/HTMLDialogElement.h b/dom/html/HTMLDialogElement.h index 7abaee81c..2222cd2f7 100644 --- a/dom/html/HTMLDialogElement.h +++ b/dom/html/HTMLDialogElement.h @@ -7,6 +7,7 @@ #ifndef HTMLDialogElement_h #define HTMLDialogElement_h +#include "mozilla/AsyncEventDispatcher.h" #include "mozilla/Attributes.h" #include "nsGenericHTMLElement.h" #include "nsGkAtoms.h" -- cgit v1.2.3