Loading dom/html/HTMLDialogElement.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void HTMLDialogElement::Show(ErrorResult& aError) { StorePreviouslyFocusedElement(); OwnerDoc()->HideAllPopoversWithoutRunningScript(); FocusDialog(); } Loading Loading @@ -148,6 +149,7 @@ void HTMLDialogElement::ShowModal(ErrorResult& aError) { StorePreviouslyFocusedElement(); OwnerDoc()->HideAllPopoversWithoutRunningScript(); FocusDialog(); aError.SuppressException(); Loading @@ -162,8 +164,6 @@ void HTMLDialogElement::FocusDialog() { doc->FlushPendingNotifications(FlushType::Frames); } doc->HideAllPopoversWithoutRunningScript(); RefPtr<Element> control = GetFocusDelegate(false /* aWithMouse */); // If there isn't one of those either, then let control be subject. Loading dom/html/HTMLDialogElement.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,11 +47,12 @@ class HTMLDialogElement final : public nsGenericHTMLElement { void QueueCancelDialog(); void RunCancelDialogSteps(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void FocusDialog(); nsString mReturnValue; protected: virtual ~HTMLDialogElement(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void FocusDialog(); JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; Loading dom/html/nsGenericHTMLElement.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ #include "mozilla/dom/HTMLBodyElement.h" #include "imgIContainer.h" #include "nsComputedDOMStyle.h" #include "mozilla/dom/HTMLDialogElement.h" #include "mozilla/dom/HTMLLabelElement.h" #include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/CustomElementRegistry.h" Loading Loading @@ -3460,6 +3461,10 @@ void nsGenericHTMLElement::TogglePopover(const Optional<bool>& aForce, // https://html.spec.whatwg.org/multipage/popover.html#popover-focusing-steps void nsGenericHTMLElement::FocusPopover() { if (auto* dialog = HTMLDialogElement::FromNode(this)) { return MOZ_KnownLive(dialog)->FocusDialog(); } if (RefPtr<Document> doc = GetComposedDoc()) { doc->FlushPendingNotifications(FlushType::Frames); } Loading Loading
dom/html/HTMLDialogElement.cpp +2 −2 Original line number Diff line number Diff line Loading @@ -87,6 +87,7 @@ void HTMLDialogElement::Show(ErrorResult& aError) { StorePreviouslyFocusedElement(); OwnerDoc()->HideAllPopoversWithoutRunningScript(); FocusDialog(); } Loading Loading @@ -148,6 +149,7 @@ void HTMLDialogElement::ShowModal(ErrorResult& aError) { StorePreviouslyFocusedElement(); OwnerDoc()->HideAllPopoversWithoutRunningScript(); FocusDialog(); aError.SuppressException(); Loading @@ -162,8 +164,6 @@ void HTMLDialogElement::FocusDialog() { doc->FlushPendingNotifications(FlushType::Frames); } doc->HideAllPopoversWithoutRunningScript(); RefPtr<Element> control = GetFocusDelegate(false /* aWithMouse */); // If there isn't one of those either, then let control be subject. Loading
dom/html/HTMLDialogElement.h +2 −1 Original line number Diff line number Diff line Loading @@ -47,11 +47,12 @@ class HTMLDialogElement final : public nsGenericHTMLElement { void QueueCancelDialog(); void RunCancelDialogSteps(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void FocusDialog(); nsString mReturnValue; protected: virtual ~HTMLDialogElement(); MOZ_CAN_RUN_SCRIPT_BOUNDARY void FocusDialog(); JSObject* WrapNode(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override; Loading
dom/html/nsGenericHTMLElement.cpp +5 −0 Original line number Diff line number Diff line Loading @@ -100,6 +100,7 @@ #include "mozilla/dom/HTMLBodyElement.h" #include "imgIContainer.h" #include "nsComputedDOMStyle.h" #include "mozilla/dom/HTMLDialogElement.h" #include "mozilla/dom/HTMLLabelElement.h" #include "mozilla/dom/HTMLInputElement.h" #include "mozilla/dom/CustomElementRegistry.h" Loading Loading @@ -3460,6 +3461,10 @@ void nsGenericHTMLElement::TogglePopover(const Optional<bool>& aForce, // https://html.spec.whatwg.org/multipage/popover.html#popover-focusing-steps void nsGenericHTMLElement::FocusPopover() { if (auto* dialog = HTMLDialogElement::FromNode(this)) { return MOZ_KnownLive(dialog)->FocusDialog(); } if (RefPtr<Document> doc = GetComposedDoc()) { doc->FlushPendingNotifications(FlushType::Frames); } Loading