Bug 1521719 - Stop the legacy urlbar binding being constructed and registering listeners when QuantumBar is enabled. r=dao
authorMark Banner <standard8@mozilla.com>
Wed, 23 Jan 2019 16:15:34 +0000
changeset 515116 9f90c6e59169405e873e76f9c72e9b6fa70877ee
parent 515115 55db5268fa7527bb676dbaea070f7742b701c269
child 515117 b6167098e831d161bfa877537aa9f5e0c6bd83a2
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1521719
milestone66.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1521719 - Stop the legacy urlbar binding being constructed and registering listeners when QuantumBar is enabled. r=dao As a result, we can also re-enable some tests running against QuantumBar. Differential Revision: https://phabricator.services.mozilla.com/D17352
browser/base/content/browser.css
browser/base/content/browser.js
browser/components/urlbar/tests/browser/browser.ini
browser/themes/shared/urlbar-searchbar.inc.css
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -546,18 +546,20 @@ toolbar:not(#TabsToolbar) > #personal-bo
   width: 1px;
   min-width: 1px;
 }
 
 #urlbar {
   -moz-binding: url(chrome://browser/content/urlbarBindings.xml#legacy-urlbar);
 }
 
-#urlbar[quantumbar] {
-  -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
+@supports -moz-bool-pref("browser.urlbar.quantumbar") {
+  #urlbar {
+    -moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
+  }
 }
 
 /* Display URLs left-to-right but right aligned in RTL mode. */
 html|input.urlbar-input:-moz-locale-dir(rtl) {
   direction: ltr !important;
   text-align: right !important;
 }
 
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -185,19 +185,16 @@ XPCOMUtils.defineLazyGetter(this, "gNavT
 
 XPCOMUtils.defineLazyGetter(this, "gURLBar", () => {
   let element = document.getElementById("urlbar");
 
   if (!Services.prefs.getBoolPref("browser.urlbar.quantumbar", false)) {
     return element;
   }
 
-  // Disable the legacy XBL binding.
-  element.setAttribute("quantumbar", "true");
-
   // Re-focus the input field if it was focused before switching bindings.
   if (element.hasAttribute("focused")) {
     element.inputField.focus();
   }
 
   return new UrlbarInput({
     textbox: element,
     panel: document.getElementById("urlbar-results"),
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -36,47 +36,43 @@ skip-if = os != "mac" # Mac only feature
 support-files =
   browser_page_action_menu_share_win.html
 skip-if = os != "win" # Windows only feature
 [browser_populateAfterPushState.js]
 [browser_urlbar_blanking.js]
 support-files =
   file_blank_but_not_blank.html
 [browser_urlbar_content_opener.js]
-skip-if = debug # Bug 1521835 - shutdown leaks
 [browser_urlbar_locationchange_urlbar_edit_dos.js]
 support-files =
   file_urlbar_edit_dos.html
 [browser_urlbar_remoteness_switch.js]
 run-if = e10s
 [browser_urlbar_searchsettings.js]
 [browser_urlbar_whereToOpen.js]
 [browser_urlbarCopying.js]
 subsuite = clipboard
 support-files =
   authenticate.sjs
 [browser_urlbarEnter.js]
-skip-if = true # Bug 1521490
 [browser_urlbarFocusedCmdK.js]
 [browser_urlbarHashChangeProxyState.js]
 [browser_UrlbarInput_formatValue.js]
 [browser_UrlbarInput_overflow.js]
 [browser_UrlbarInput_tooltip.js]
 [browser_UrlbarInput_trimURLs.js]
 subsuite = clipboard
 [browser_UrlbarInput_unit.js]
 support-files = empty.xul
 [browser_UrlbarLoadRace.js]
-skip-if = true # Bug 1521490
 [browser_urlbarPlaceholder.js]
 support-files =
   searchSuggestionEngine.xml
   searchSuggestionEngine.sjs
 [browser_urlbarRevert.js]
 [browser_urlbarSearchSingleWordNotification.js]
-skip-if = debug # Bug 1521513 - shutdown leaks.
 [browser_URLBarSetURI.js]
-skip-if = debug # Linux & Mac: bug 970052 and bug 970053. Windows: bug 1521532
+skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
 [browser_urlbarUpdateForDomainCompletion.js]
 [browser_wyciwyg_urlbarCopying.js]
 subsuite = clipboard
 support-files =
   test_wyciwyg_copying.html
--- a/browser/themes/shared/urlbar-searchbar.inc.css
+++ b/browser/themes/shared/urlbar-searchbar.inc.css
@@ -313,18 +313,20 @@
 
 .urlbar-history-dropmarker {
   -moz-appearance: none;
   list-style-image: url(chrome://global/skin/icons/arrow-dropdown-16.svg);
   transition: opacity 0.15s ease;
 }
 
 /* Avoid re-opening the popup when the dropmarker is clicked while the popup is still open. */
-#urlbar:not([quantumbar]) > .urlbar-history-dropmarker[open] {
-  pointer-events: none;
+@supports not -moz-bool-pref("browser.urlbar.quantumbar") {
+  .urlbar-history-dropmarker[open] {
+    pointer-events: none;
+  }
 }
 
 #urlbar[switchingtabs] > .urlbar-history-dropmarker {
   transition: none;
 }
 
 #nav-bar:not([customizing="true"]) > #nav-bar-customization-target > #urlbar-container:not(:hover) > #urlbar:not([focused]) > .urlbar-history-dropmarker,
 #nav-bar:not([customizing="true"]) > #nav-bar-customization-target > #urlbar-container:not(:hover) > #urlbar.hidden-focus > .urlbar-history-dropmarker {