Backed out changeset 15c988d7b6a1 (bug 1327946) for failing own test browser_identityBlock_focus.js. r=backout a=backout on a CLOSED TREE
authorSebastian Hengst <archaeopteryx@coole-files.de>
Wed, 01 Feb 2017 18:49:31 +0100
changeset 366827 964388f3501946027b15ef9af6e6bca2f4096552
parent 366826 d13a909fc8a10c8a691f4fc386b290a995d18f32
child 366828 7ae2c069b120e60447044dfff9b682652825e14a
push id6860
push userarchaeopteryx@coole-files.de
push dateWed, 01 Feb 2017 17:49:55 +0000
treeherdermozilla-beta@964388f35019 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1327946
milestone52.0
backs out15c988d7b6a1724af64f720396cf9570cf74f7a8
Backed out changeset 15c988d7b6a1 (bug 1327946) for failing own test browser_identityBlock_focus.js. r=backout a=backout on a CLOSED TREE
browser/base/content/browser.css
browser/base/content/browser.xul
browser/base/content/test/siteIdentity/browser.ini
browser/base/content/test/siteIdentity/browser_identityBlock_focus.js
browser/base/content/test/siteIdentity/head.js
browser/base/moz.build
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -567,23 +567,18 @@ toolbar:not(#TabsToolbar) > #personal-bo
 #urlbar:not([focused="true"]) > #urlbar-go-button {
   visibility: collapse;
 }
 
 #urlbar[pageproxystate="invalid"] > #identity-box > #identity-icon-labels {
   visibility: collapse;
 }
 
-#identity-box {
-  -moz-user-focus: normal;
-}
-
 #urlbar[pageproxystate="invalid"] > #identity-box {
   pointer-events: none;
-  -moz-user-focus: ignore;
 }
 
 #urlbar[pageproxystate="invalid"] > #identity-box > #notification-popup-box {
   pointer-events: auto;
 }
 
 #identity-icon-labels {
   max-width: 18em;
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -682,19 +682,23 @@
                      tabscrolling="true"
                      showcommentcolumn="true"
                      showimagecolumn="true"
                      enablehistory="true"
                      maxrows="10"
                      newlines="stripsurroundingwhitespace"
                      ontextentered="this.handleCommand(param);"
                      ontextreverted="return this.handleRevert();"
-                     pageproxystate="invalid">
+                     pageproxystate="invalid"
+                     onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
+                     onblur="setTimeout(() => { document.getElementById('identity-box').style.MozUserFocus = ''; }, 0);">
               <!-- Use onclick instead of normal popup= syntax since the popup
-                   code fires onmousedown, and hence eats our favicon drag events. -->
+                   code fires onmousedown, and hence eats our favicon drag events.
+                   We only add the identity-box button to the tab order when the location bar
+                   has focus, otherwise pressing F6 focuses it instead of the location bar -->
               <box id="identity-box" role="button"
                    align="center"
                    aria-label="&urlbar.viewSiteInfo.label;"
                    onclick="gIdentityHandler.handleIdentityButtonEvent(event);"
                    onkeypress="gIdentityHandler.handleIdentityButtonEvent(event);"
                    ondragstart="gIdentityHandler.onDragStart(event);">
                 <image id="identity-icon"
                        consumeanchor="identity-box"
deleted file mode 100644
--- a/browser/base/content/test/siteIdentity/browser.ini
+++ /dev/null
@@ -1,7 +0,0 @@
-[DEFAULT]
-support-files =
-  head.js
-
-[browser_identityBlock_focus.js]
-skip-if = os == 'mac' # Bug 1334418 (try only)
-support-files = ../general/permissions.html
deleted file mode 100644
--- a/browser/base/content/test/siteIdentity/browser_identityBlock_focus.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/* Tests that the identity block can be reached via keyboard
- * shortcuts and that it has the correct tab order.
- */
-
-const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/content", "https://example.com");
-const PERMISSIONS_PAGE = TEST_PATH + "permissions.html";
-
-function synthesizeKeyAndWaitForFocus(element, keyCode, options) {
-  let focused = BrowserTestUtils.waitForEvent(element, "focus");
-  EventUtils.synthesizeKey(keyCode, options);
-  return focused;
-}
-
-// Checks that the identity block is the next element after the urlbar
-// to be focused if there are no active notification anchors.
-add_task(function* testWithoutNotifications() {
-  yield BrowserTestUtils.withNewTab("https://example.com", function*() {
-    yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
-    is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
-    yield synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true})
-    is(document.activeElement, gIdentityHandler._identityBox,
-       "identity block should be focused");
-  });
-});
-
-// Checks that when there is a notification anchor, it will receive
-// focus before the identity block.
-add_task(function* testWithoutNotifications() {
-
-  yield BrowserTestUtils.withNewTab(PERMISSIONS_PAGE, function*(browser) {
-    let popupshown = BrowserTestUtils.waitForEvent(PopupNotifications.panel, "popupshown");
-    // Request a permission;
-    BrowserTestUtils.synthesizeMouseAtCenter("#geo", {}, browser);
-    yield popupshown;
-
-    yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
-    is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
-    let geoIcon = document.getElementById("geo-notification-icon");
-    yield synthesizeKeyAndWaitForFocus(geoIcon, "VK_TAB", {shiftKey: true})
-    is(document.activeElement, geoIcon, "notification anchor should be focused");
-    yield synthesizeKeyAndWaitForFocus(gIdentityHandler._identityBox, "VK_TAB", {shiftKey: true})
-    is(document.activeElement, gIdentityHandler._identityBox,
-       "identity block should be focused");
-  });
-});
-
-// Checks that with invalid pageproxystate the identity block is ignored.
-add_task(function* testInvalidPageProxyState() {
-  yield BrowserTestUtils.withNewTab("about:blank", function*(browser) {
-    // Loading about:blank will automatically focus the urlbar, which, however, can
-    // race with the test code. So we only send the shortcut if the urlbar isn't focused yet.
-    if (document.activeElement != gURLBar.inputField) {
-      yield synthesizeKeyAndWaitForFocus(gURLBar, "l", {accelKey: true})
-    }
-    is(document.activeElement, gURLBar.inputField, "urlbar should be focused");
-    yield synthesizeKeyAndWaitForFocus(gBrowser.getTabForBrowser(browser), "VK_TAB", {shiftKey: true})
-    isnot(document.activeElement, gIdentityHandler._identityBox,
-          "identity block should not be focused");
-    // Restore focus to the url bar.
-    gURLBar.focus();
-  });
-});
deleted file mode 100644
--- a/browser/base/content/test/siteIdentity/head.js
+++ /dev/null
@@ -1,6 +0,0 @@
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-
-XPCOMUtils.defineLazyModuleGetter(this, "Promise",
-  "resource://gre/modules/Promise.jsm");
-XPCOMUtils.defineLazyModuleGetter(this, "Task",
-  "resource://gre/modules/Task.jsm");
--- a/browser/base/moz.build
+++ b/browser/base/moz.build
@@ -17,17 +17,16 @@ MOCHITEST_CHROME_MANIFESTS += [
 BROWSER_CHROME_MANIFESTS += [
     'content/test/alerts/browser.ini',
     'content/test/captivePortal/browser.ini',
     'content/test/general/browser.ini',
     'content/test/newtab/browser.ini',
     'content/test/plugins/browser.ini',
     'content/test/popupNotifications/browser.ini',
     'content/test/referrer/browser.ini',
-    'content/test/siteIdentity/browser.ini',
     'content/test/social/browser.ini',
     'content/test/tabcrashed/browser.ini',
     'content/test/tabPrompts/browser.ini',
     'content/test/tabs/browser.ini',
     'content/test/urlbar/browser.ini',
     'content/test/webrtc/browser.ini',
 ]