forked from mirrors/gecko-dev
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 |
||
|---|---|---|
| .. | ||
| content | ||
| gen_aboutneterror_codes.py | ||
| jar.mn | ||
| moz.build | ||