Bug 981310 - Displayed error tapping navbar under input element after URL TextSelection, r=jimm
authorMark Capella <markcapella@twcny.rr.com>
Tue, 11 Mar 2014 19:25:28 -0400
changeset 190330 58aaf5762a1be10e1e349cd712d5c8600d9c386b
parent 190329 0dd716985cd28e2ea76e92718c026594847d9e32
child 190331 8d6720456275408b376b92879863236319ee9337
push id3503
push userraliiev@mozilla.com
push dateMon, 28 Apr 2014 18:51:11 +0000
treeherdermozilla-beta@c95ac01e332e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjimm
bugs981310
milestone30.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 981310 - Displayed error tapping navbar under input element after URL TextSelection, r=jimm
browser/metro/base/content/ContextUI.js
browser/metro/base/content/bindings/urlbar.xml
--- a/browser/metro/base/content/ContextUI.js
+++ b/browser/metro/base/content/ContextUI.js
@@ -168,21 +168,30 @@ var ContextUI = {
     aDelay = aDelay || kForegroundTabAnimationDelay;
     this._clearDelayedTimeout();
     this._lastTimeoutDelay = aDelay;
     this._hidingId = setTimeout(function () {
         ContextUI.dismissTabs();
       }, aDelay);
   },
 
-  // Display the nav bar
+  /*
+   * Display the nav bar.
+   *
+   * @return false if we were already visible, and didn't do anything.
+   */
   displayNavbar: function () {
+    if (Elements.chromeState.getAttribute("navbar") == "visible") {
+      return false;
+    }
+
     Elements.navbar.show();
     Elements.chromeState.setAttribute("navbar", "visible");
     ContentAreaObserver.updateContentArea();
+    return true;
   },
 
   // Display the tab tray
   displayTabs: function () {
     this._clearDelayedTimeout();
     this._setIsExpanded(true);
   },
 
--- a/browser/metro/base/content/bindings/urlbar.xml
+++ b/browser/metro/base/content/bindings/urlbar.xml
@@ -279,18 +279,25 @@
         <body>
           <![CDATA[
             if (this.isEditing)
               return;
 
             Elements.urlbarState.setAttribute("editing", true);
             this._lastKnownGoodURL = this.value;
 
-            if (!this.focused)
+            if (!this.focused) {
               this.focus();
+              // If we force focus, ensure we're visible.
+              if (ContextUI.displayNavbar()) {
+                // If we forced visibility, ensure we're positioned above keyboard.
+                // (Previous "blur" may have forced us down behind it.)
+                ContentAreaObserver.updateAppBarPosition();
+              }
+            }
 
             this._clearFormatting();
             this.select();
 
             if (aShouldDismiss)
               ContextUI.dismissTabs();
 
             if (!InputSourceHelper.isPrecise) {