Backed out changeset 1c227ac918eb (bug 1515044) for Browser-chrome in browser/components/urlbar/tests/browser/browser_UrlbarInput_hiddenFocus.js. CLOSED TREE
authorDorel Luca <dluca@mozilla.com>
Wed, 23 Jan 2019 18:08:37 +0200
changeset 515115 55db5268fa7527bb676dbaea070f7742b701c269
parent 515114 bdf9d6dfa2f6fbe1c69fb9715b9368c7c8ede8c0
child 515116 9f90c6e59169405e873e76f9c72e9b6fa70877ee
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)
bugs1515044
milestone66.0a1
backs out1c227ac918eb1ab0b702d4424603faeb836f2b1c
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
Backed out changeset 1c227ac918eb (bug 1515044) for Browser-chrome in browser/components/urlbar/tests/browser/browser_UrlbarInput_hiddenFocus.js. CLOSED TREE
browser/base/content/urlbarBindings.xml
browser/components/about/AboutPrivateBrowsingHandler.jsm
browser/components/urlbar/UrlbarInput.jsm
browser/components/urlbar/tests/browser/browser.ini
browser/components/urlbar/tests/browser/browser_UrlbarInput_hiddenFocus.js
--- a/browser/base/content/urlbarBindings.xml
+++ b/browser/base/content/urlbarBindings.xml
@@ -1709,17 +1709,17 @@ file, You can obtain one at http://mozil
       </method>
 
       <method name="removeHiddenFocus">
         <body><![CDATA[
           this.classList.remove("hidden-focus");
         ]]></body>
       </method>
 
-      <method name="setHiddenFocus">
+      <method name="hiddenFocus">
         <body><![CDATA[
           this.classList.add("hidden-focus");
           this.focus();
         ]]></body>
       </method>
     </implementation>
 
     <handlers>
--- a/browser/components/about/AboutPrivateBrowsingHandler.jsm
+++ b/browser/components/about/AboutPrivateBrowsingHandler.jsm
@@ -47,17 +47,17 @@ var AboutPrivateBrowsingHandler = {
         let searchAliases = Services.search.defaultEngine.wrappedJSObject.__internalAliases;
         if (searchAliases && searchAliases.length > 0) {
           searchAlias = `${searchAliases[0]} `;
         }
         let urlBar = aMessage.target.browser.ownerGlobal.gURLBar;
         let isFirstChange = true;
 
         if (!aMessage.data || !aMessage.data.text) {
-          urlBar.setHiddenFocus();
+          urlBar.hiddenFocus();
         } else {
           // Pass the provided text to the awesomebar. Prepend the @engine shortcut.
           urlBar.search(`${searchAlias}${aMessage.data.text}`);
           isFirstChange = false;
         }
 
         let checkFirstChange = () => {
           // Check if this is the first change since we hidden focused. If it is,
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -406,33 +406,16 @@ class UrlbarInput {
 
     this.inputField.value = char + " ";
 
     let event = this.document.createEvent("UIEvents");
     event.initUIEvent("input", true, false, this.window, 0);
     this.inputField.dispatchEvent(event);
   }
 
-  /**
-   * Focus without the focus styles.
-   * This is used by Activity Stream and about:privatebrowsing for search hand-off.
-   */
-  setHiddenFocus() {
-    this.textbox.classList.add("hidden-focus");
-    this.focus();
-  }
-
-  /**
-   * Remove the hidden focus styles.
-   * This is used by Activity Stream and about:privatebrowsing for search hand-off.
-   */
-  removeHiddenFocus() {
-    this.textbox.classList.remove("hidden-focus");
-  }
-
   // Getters and Setters below.
 
   get focused() {
     return this.textbox.getAttribute("focused") == "true";
   }
 
   get goButton() {
     return this.document.getAnonymousElementByAttribute(this.textbox, "anonid",
--- a/browser/components/urlbar/tests/browser/browser.ini
+++ b/browser/components/urlbar/tests/browser/browser.ini
@@ -53,17 +53,16 @@ run-if = e10s
 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_hiddenFocus.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
deleted file mode 100644
--- a/browser/components/urlbar/tests/browser/browser_UrlbarInput_hiddenFocus.js
+++ /dev/null
@@ -1,21 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
-   http://creativecommons.org/publicdomain/zero/1.0/ */
-
-add_task(async function() {
-  let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser);
-
-  registerCleanupFunction(async function() {
-    BrowserTestUtils.removeTab(tab);
-    URLBarSetURI();
-  });
-
-  gURLBar.blur();
-  ok(!gURLBar.hasAttribute("focused") && !gURLBar.classList.contains("hidden-focus"),
-     "url bar is not focused or hidden");
-  gURLBar.setHiddenFocus();
-  ok(gURLBar.hasAttribute("focused") && gURLBar.classList.contains("hidden-focus"),
-    "url bar is focused and hidden");
-  gURLBar.removeHiddenFocus();
-  ok(gURLBar.hasAttribute("focused") && !gURLBar.classList.contains("hidden-focus"),
-    "url bar is focused and not hidden");
-});