This also fixes links in top or in-process subframes and out-of-process subframes in extensions sidebars and panels so that they open in new tabs.
Differential Revision: https://phabricator.services.mozilla.com/D110102
Fairly self-explanatory. This just extends the tab-based modal popup hiding
behavior to modals going through gDialogBox.
Differential Revision: https://phabricator.services.mozilla.com/D109527
This effectively mirrors the panel hiding logic we use to hide
PopupNotifications panels so that we also hide notifications attached to the
hamburger menu. This will cover alerts and other similar modals originating
from content.
Differential Revision: https://phabricator.services.mozilla.com/D109526
This ensures the modal is visible. I'm deliberately not doing this for content or tab-modal
prompts, where there wasn't a history of doing this and where I think it would open up
dos-style annoyance vectors.
Differential Revision: https://phabricator.services.mozilla.com/D109058
Due to some kind of weirdness, you can end up with a weakly held preference
callback being run even after the DOM objects it holds references to are unlinked
by the cycle collector, which can cause crashes. This patch works around
that by taking advantage of the fact that we now drop weak references to DOM
objects when they are unlinked to change the preference callback closure to
instead hold a weak reference.
Differential Revision: https://phabricator.services.mozilla.com/D109031
The widget is only added if screenshots are enabled (similar behavior to the fxa
toolbar button).
Button must take into account onLocationChange due to the fact that screenshots
extension is not available on about pages.
Adds a test for the disabled state, with more screenshot tests intended in the future
Differential Revision: https://phabricator.services.mozilla.com/D107727
The preference shouldn't affect WebExtensions as it is non-obvious (WebExtensions might not be using a context menu so a user wouldn't expect that preference to affect them), and WebExtensions can choose themselves if a tab needs to be in the background or not.
This also removes it from the command line search flow where it had no effect anyway.
Differential Revision: https://phabricator.services.mozilla.com/D107870
The html:dialog event can respond to [esc] keypresses itself. In that case,
we need to close the embedded dialog ourselves, or the UI ends up broken.
We also need to make sure that if e.g. the opening multiple pages from bookmarks warning is up,
and then the user tries to quit or in some other way opens another dialog, things don't break.
This also applies to tests that repeatedly invoke dialogs, where we need to wait for both
the SubDialog instance and the wrapping html:dialog element to agree on their state.
Differential Revision: https://phabricator.services.mozilla.com/D107463
With the changes in this patch stack, it will become more common for frontend
code to receive onLocationChange notifications for subframes, as we will now
correctly report events for oop subframes, and will also deliver notifications
for the first document loaded in subframes in order to update the current remote
URI on CanonicalBrowsingContext.
This change makes more of the callbacks fired by onLocationChange be guarded by
the isTopLevel check, including setting the "URL" crash annotation and updating
the macOS touchbar, which should hopefully both fix existing latent bugs, and
ensure that these issues don't occur with the more frequent onLocationChange
callbacks.
Differential Revision: https://phabricator.services.mozilla.com/D105554
The html:dialog event can respond to [esc] keypresses itself. In that case,
we need to close the embedded dialog ourselves, or the UI ends up broken.
Differential Revision: https://phabricator.services.mozilla.com/D107463
This commit uses CSS grid layout to position content modal prompts, and to get the
requisite 5% top and bottom margins in a way that doesn't require JS to update,
and adapts to resizing and things like the find bar and devtools opening. To make
this work right it also removes the 5px negative top margin for these dialogs.
Then this commit adds some logic to SubDialog.jsm to support this behaviour.
Prior to this change, SubDialog.jsm sets height/width on the dialogs that go
through it, except if they pass sizeto=available (used by the print dialog).
This new sizeTo value similarly avoids all the complex sizing logic - but also
avoids the print logic of having an aspect ratio to maintain when the window
changes size. We use the content size it determines to set the height of the
dialog (a grid row): either 90% (so there's 5% above and 5% below) or the
document height, whichever is smaller.
The next commit will use this setup to deal with the problem of variable length
content inside the dialog that we're trying to show.
Differential Revision: https://phabricator.services.mozilla.com/D107110
CLOSED TREE
Backed out changeset 0580aaec32a0 (bug 1693277)
Backed out changeset be8108cd9820 (bug 1693277)
Backed out changeset 8b9986d057d7 (bug 1693277)
This commit uses CSS grid layout to position content modal prompts, and to get the
requisite 5% top and bottom margins in a way that doesn't require JS to update,
and adapts to resizing and things like the find bar and devtools opening. To make
this work right it also removes the 5px negative top margin for these dialogs.
Then this commit adds some logic to SubDialog.jsm to support this behaviour.
Prior to this change, SubDialog.jsm sets height/width on the dialogs that go
through it, except if they pass sizeto=available (used by the print dialog).
This new sizeTo value similarly avoids all the complex sizing logic - but also
avoids the print logic of having an aspect ratio to maintain when the window
changes size. We use the content size it determines to set the height of the
dialog (a grid row): either 90% (so there's 5% above and 5% below) or the
document height, whichever is smaller.
The next commit will use this setup to deal with the problem of variable length
content inside the dialog that we're trying to show.
Differential Revision: https://phabricator.services.mozilla.com/D107110
FillHistoryMenu was returning early and preventing the context menu from opening when there is only one history item. For long-presses, the menu typically doesn't open until after the updateSessionHistory callback was finished so the menu shows properly, but context menus have no delay. However, when browsingContext.sessionHistory is available, we can get the history without callbacks.
Also, combine the two similar session history tests into one more complete test.
Differential Revision: https://phabricator.services.mozilla.com/D106694