Bug 1475589 - Remove the focused attribute early on the urlbar when adopting a tab, to ensure the url gets properly formatted. r=Gijs, a=lizzard
authorFlorian Quèze <florian@queze.net>
Fri, 27 Jul 2018 23:00:27 +0200
changeset 478375 e2e1d461ee93
parent 478374 40006339de0c
child 478376 4471d22def67
push id9639
push userryanvm@gmail.com
push date2018-08-10 20:54 +0000
treeherdermozilla-beta@4471d22def67 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, lizzard
bugs1475589
milestone62.0
Bug 1475589 - Remove the focused attribute early on the urlbar when adopting a tab, to ensure the url gets properly formatted. r=Gijs, a=lizzard
browser/base/content/browser.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -1370,16 +1370,19 @@ var gBrowserInit = {
     // avoid an about:blank flash.
     let tabToAdopt = this.getTabToAdopt();
     if (tabToAdopt) {
       // Stop the about:blank load
       gBrowser.stop();
       // make sure it has a docshell
       gBrowser.docShell;
 
+      // Remove the speculative focus from the urlbar to let the url be formatted.
+      gURLBar.removeAttribute("focused");
+
       try {
         gBrowser.swapBrowsersAndCloseOther(gBrowser.selectedTab, tabToAdopt);
       } catch (e) {
         Cu.reportError(e);
       }
 
       // Clear the reference to the tab once its adoption has been completed.
       this._clearTabToAdopt();