This converts the tabmodalprompt binding to a class, to be constructed along side with the element
by TabModalPromptBox.
TabModalPromptBox will keep the instances in a map and pass it to the callers, instead of the element.
The tests and callers can access the class instance by passing the element reference to the map.
Differential Revision: https://phabricator.services.mozilla.com/D15505
--HG--
rename : toolkit/components/prompts/content/tabprompts.xml => toolkit/components/prompts/content/tabprompts.jsm
extra : moz-landing-system : lando
With the conformant promising scheduling, the promise callback can be performed
eariler at the returning from a event listener if possible instead of the end
of current task.
The resolving of "selected" change of the openedTab becomes part of the process
of RemotePrompt.openTabPrompt() where the 'DOMWillOpenModalDialog' event is fired.
We should resume the test at next tick to ensure that the openTabPrompt() is
done before removing the openedTab.
If we synchronously shut down the prompt, that will exit modal state while we're
still processing our mouse or key event, which happens _before_ Gecko runnable
processing. Exiting modal state will generally post a runnable to run timeouts,
so we can end up processing that runnable before we return from processNextEvent
and unwind to whatever code did the alert() call on the web page. The upshot is
that the webpage will see timeouts fire before the alert() call returns.
If we exit modal state off a Gecko runnable instead, that will ensure that we
return to the nsPrompter code immediately after exiting modal state, see that
the prompt is no longer active, and return to the calling web page code _before_
processing any more runnables.
Adds a tabspecific attribute to the edit bookmarks panel and the Pocket subview panel to signal that these popups should close when the user navigates away from the tab. It also specifies that the localized keyboard short cut for closing a window should close the edit bookmarks panel and the tab by adding a general function to check whether a certain <key> has been pressed. Adds tests for both closing specific tabs and checking keys.
MozReview-Commit-ID: AxW5uQgDQQB
--HG--
extra : rebase_source : 76f649492e719317a9ef71895e9cb1d600ea67b1