fune/browser/base
Drew Willcoxon 4a6570ffd6 Bug 1659128 - Exit search mode as appropriate when input.setURI is called. r=harry
We need to exit search mode when a page loads in the current tab. We may need to
exit search mode for page loads in other tabs too: If you're in search mode,
click a slow link, switch tabs, and the page loads in the meantime, then search
mode should be not be entered when you switch back. I don't think we handle that
case correctly right now, and this patch doesn't address that at all. That's
worth doing in another bug because I think the fix will be different.

At first I added an `onLocationChange` method to UrlbarInput that was called by
`XULBrowserWindow.onLocationChange` in browser.js [1], just like we have an
`onLocationChange` in UrlbarProviderSearchTips called by
`XULBrowserWindow.onLocationChange`. But we need to potentially exit search mode
any time `input.setURI` is called. `setURI` happens to be called by
`XULBrowserWindow.onLocationChange`, one of the several places that calls it
[2].

`setURI` is also called when switching tabs. Bug 1647899 already took care of
handling search mode for tab switches, but it would be nice to handle all this
in one place. `setURI` is also how `userTypedValue` is restored in the input,
and of course `userTypedValue` is something we need to restore when switching
tabs, just like search mode. For these reasons I moved per-tab search mode
restoration to `setURI` as part of this.

I'm also changing the name of the second parameter in `setURI`. I wasn't sure
whether it's true iff we're switching tabs, so I tracked down why that param was
added. It was added in bug 1478348, and comment 21 confirms it was added to tell
`setURI` and `XULBrowserWindow.onLocationChange` when they're being called due
to a tab switch. To make this clearer, I renamed the param and added some
javadoc for `XULBrowserWindow.onLocationChange`.

[1] https://searchfox.org/mozilla-central/rev/50cb0892948fb4291b9a6b1b30122100ec7d4ef2/browser/base/content/browser.js#5205
[2] https://searchfox.org/mozilla-central/search?q=symbol:%23setURI&redirect=false

Differential Revision: https://phabricator.services.mozilla.com/D87172
2020-08-17 20:31:44 +00:00
..
content Bug 1659128 - Exit search mode as appropriate when input.setURI is called. r=harry 2020-08-17 20:31:44 +00:00
gen_aboutneterror_codes.py Bug 1642725 - use sets of known message identifiers to limit possible error titles and messages instead of consulting fluent, r=zbraniecki,prathiksha,fluent-reviewers,Pike 2020-07-06 11:12:08 +00:00
jar.mn Bug 1655044 - Replace FPN Logo. r=prathiksha 2020-07-27 18:35:46 +00:00
moz.build Bug 1657992 - Handle middle-click on long-press backForwardMenu only once + tests r=dao 2020-08-12 14:50:42 +00:00