Bug 899726 - Defect - during keyboard showing/hiding, sometimes hidden appbars show up. r=mbrubeck
authorJonathan Wilde <jwilde@jwilde.me>
Thu, 01 Aug 2013 11:59:17 -0700
changeset 153259 42c35a94058bbd5259783bb8398b233eb6b20fb2
parent 153258 f4bb9ef3bf6389222d1dff4228bbfb4d56f9b4aa
child 153260 b6b697ead5340bc09d1bb0e86db22188ceb9d29d
push id2859
push userakeybl@mozilla.com
push dateMon, 16 Sep 2013 19:14:59 +0000
treeherdermozilla-beta@87d3c51cd2bf [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmbrubeck
bugs899726
milestone25.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 899726 - Defect - during keyboard showing/hiding, sometimes hidden appbars show up. r=mbrubeck
browser/metro/base/content/ContextUI.js
browser/metro/base/content/bindings/appbar.xml
browser/metro/base/content/helperui/FindHelperUI.js
browser/metro/theme/browser.css
browser/metro/theme/platform.css
--- a/browser/metro/base/content/ContextUI.js
+++ b/browser/metro/base/content/ContextUI.js
@@ -176,17 +176,19 @@ var ContextUI = {
   // Display the tab tray
   displayTabs: function () {
     this._clearDelayedTimeout();
     this._setIsExpanded(true);
   },
 
   // Dismiss the navbar if visible.
   dismissNavbar: function dismissNavbar() {
-    Elements.navbar.dismiss();
+    if (!StartUI.isVisible) {
+      Elements.navbar.dismiss();
+    }
   },
 
   // Dismiss the tabstray if visible.
   dismissTabs: function dimissTabs() {
     this._clearDelayedTimeout();
     this._setIsExpanded(false);
   },
 
--- a/browser/metro/base/content/bindings/appbar.xml
+++ b/browser/metro/base/content/bindings/appbar.xml
@@ -1,14 +1,14 @@
-<?xml version="1.0"?>  
+<?xml version="1.0"?>
 
 <bindings xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
-  <binding id="appbarBinding">  
-    <content> 
+  <binding id="appbarBinding">
+    <content>
       <xul:toolbar anonid="toolbar"><children/></xul:toolbar>
     </content>
 
     <implementation implements="nsIDOMEventListener">
       <field name="sticky">false</field>
       <field name="_toolbar" readonly="true">document.getAnonymousElementByAttribute(this, "anonid", "toolbar");</field>
 
       <property name="isShowing" readonly="true">
@@ -24,23 +24,30 @@
         <body>
           <![CDATA[
             let event = document.createEvent("Events");
             event.initEvent(aName, true, false);
             this.dispatchEvent(event);
           ]]>
         </body>
       </method>
-      
+
       <method name="dismiss">
         <body>
           <![CDATA[
             if (!this.isShowing)
               return;
 
+            let self = this;
+            this.setAttribute("hiding", "true");
+            this.addEventListener("transitionend", function appbar_transitionend() {
+              self.removeEventListener("transitionend", appbar_transitionend, false);
+              self.removeAttribute("hiding");
+            }, false);
+
             this._fire("MozAppbarDismissing");
             this.removeAttribute("visible");
           ]]>
         </body>
       </method>
 
       <method name="show">
         <body>
--- a/browser/metro/base/content/helperui/FindHelperUI.js
+++ b/browser/metro/base/content/helperui/FindHelperUI.js
@@ -111,25 +111,26 @@ var FindHelperUI = {
       return;
 
     // Hide any menus
     ContextUI.dismiss();
 
     // Shutdown selection related ui
     SelectionHelperUI.closeEditSession();
 
-    this.search(this._textbox.value);
-    this._textbox.select();
-    this._textbox.focus();
-    this._open = true;
-
     let findbar = this._container;
     setTimeout(() => {
       Elements.browsers.setAttribute("findbar", true);
       findbar.show();
+
+      this.search(this._textbox.value);
+      this._textbox.select();
+      this._textbox.focus();
+
+      this._open = true;
     }, 0);
 
     // Prevent the view to scroll automatically while searching
     Browser.selectedBrowser.scrollSync = false;
   },
 
   hide: function findHelperHide() {
     if (!this._open)
--- a/browser/metro/theme/browser.css
+++ b/browser/metro/theme/browser.css
@@ -439,20 +439,16 @@ documenttab[selected] .documenttab-selec
 #overlay-plus[mousedrag] {
   transition-property: left, right, transform, background-position,
                        background-color, background-size, border-color,
                        visibility, box-shadow;
 }
 
 /* Navigation bar ========================================================== */
 
-#navbar[startpage] {
-  transform: none;
-}
-
 /* Progress meter ---------------------------------------------------------- */
 
 #progress-container {
   display: block;
   position: absolute;
   top: -@progress_height@;
   height: @progress_height@;
   width: 100%;
--- a/browser/metro/theme/platform.css
+++ b/browser/metro/theme/platform.css
@@ -674,46 +674,54 @@ arrowbox {
   content: ">";
 }
 
 .meta-section:not([expanded]) > .meta-section-title.narrow-title:-moz-locale-dir(rtl):before {
   content: "<";
 }
 
 /* App bars ----------------------------------------------------------------- */
+
 appbar {
   display: block;
   position: fixed;
   bottom: 0;
   width: 100%;
   transform: translateY(100%);
   transition: transform @metro_animation_duration@ @metro_animation_easing@;
   font-size: 0;
+  visibility: hidden;
 }
 
-appbar toolbar {
-  -moz-appearance: none;
-  -moz-box-align: center;
-  border: 0;
-  width: 100%;
-  min-height: @toolbar_height@;
-  font-size: 1rem;
+appbar[hiding],
+appbar[visible] {
+  visibility: visible;
 }
 
 appbar[visible] {
   transform: none;
 }
 
 #stack[keyboardVisible] > appbar {
   /* Slow the bottom up transition since it's impossible to match the system's
      soft keyboard movement. */
   transition: transform @metro_animation_duration@ @metro_animation_easing@,
               bottom @appbar_keyboard_slideup_duration@ @metro_animation_easing@;
 }
 
+
+appbar toolbar {
+  -moz-appearance: none;
+  -moz-box-align: center;
+  border: 0;
+  width: 100%;
+  min-height: @toolbar_height@;
+  font-size: 1rem;
+}
+
 appbar toolbar toolbarbutton {
   border: 0;
   margin: 0 @toolbar_horizontal_spacing@;
   padding: 0;
   /* Don't inherit background-color from toolbarbutton[checked="true"] */
   background-color: transparent;
 }