Bug 1327946 - Remove conditional moz-user-focus on identity block from urlbar. r=Gijs draft
authorJohann Hofmann <jhofmann@mozilla.com>
Tue, 24 Jan 2017 11:42:09 +0100
changeset 465628 a7967aafabb8ef31b67e01ee2fe71b3e61c92948
parent 465527 8ff550409e1d1f8b54f6f7f115545dbef857be0b
child 543200 cfece8f58fe31e112abaa5124bc0c121b60f2bfa
push id42655
push userbmo:jhofmann@mozilla.com
push dateTue, 24 Jan 2017 15:15:23 +0000
reviewersGijs
bugs1327946
milestone54.0a1
Bug 1327946 - Remove conditional moz-user-focus on identity block from urlbar. r=Gijs MozReview-Commit-ID: 9F39TeDIGUf
browser/base/content/browser.css
browser/base/content/browser.xul
--- a/browser/base/content/browser.css
+++ b/browser/base/content/browser.css
@@ -560,18 +560,23 @@ toolbar:not(#TabsToolbar) > #personal-bo
 }
 
 #urlbar[pageproxystate="invalid"] > #identity-box > #blocked-permissions-container,
 #urlbar[pageproxystate="invalid"] > #identity-box > #notification-popup-box,
 #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;
 }
 
 #identity-icon-labels {
   max-width: 18em;
 }
 @media (max-width: 700px) {
   #urlbar-container {
     min-width: 45ch;
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -684,23 +684,19 @@
                      tabscrolling="true"
                      showcommentcolumn="true"
                      showimagecolumn="true"
                      enablehistory="true"
                      maxrows="10"
                      newlines="stripsurroundingwhitespace"
                      ontextentered="this.handleCommand(param);"
                      ontextreverted="return this.handleRevert();"
-                     pageproxystate="invalid"
-                     onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
-                     onblur="setTimeout(() => { document.getElementById('identity-box').style.MozUserFocus = ''; }, 0);">
+                     pageproxystate="invalid">
               <!-- Use onclick instead of normal popup= syntax since the popup
-                   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 -->
+                   code fires onmousedown, and hence eats our favicon drag events. -->
               <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"