Bug 1589826 - Remove the megabar's "focused & collapsed" state. r=harry
☠☠ backed out by 565c9ca9735c ☠ ☠
authorDão Gottwald <dao@mozilla.com>
Tue, 05 Nov 2019 13:01:37 +0000
changeset 500578 283c5335d006f25e97766ccc31bbf7725c15ee24
parent 500577 df6ed1641070d221eee40e942ae0aed7b5569d12
child 500579 df999d1f7c6e4f3c34c44ba5e3f69bf3b5457fd6
push id99703
push userhtwyford@mozilla.com
push dateTue, 05 Nov 2019 13:07:06 +0000
treeherderautoland@283c5335d006 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersharry
bugs1589826
milestone72.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 1589826 - Remove the megabar's "focused & collapsed" state. r=harry Differential Revision: https://phabricator.services.mozilla.com/D49824
browser/components/urlbar/UrlbarController.jsm
browser/components/urlbar/UrlbarInput.jsm
browser/themes/linux/browser.css
browser/themes/osx/browser.css
browser/themes/windows/browser.css
--- a/browser/components/urlbar/UrlbarController.jsm
+++ b/browser/components/urlbar/UrlbarController.jsm
@@ -297,17 +297,16 @@ class UrlbarController {
 
     switch (event.keyCode) {
       case KeyEvent.DOM_VK_ESCAPE:
         if (executeAction) {
           if (this.view.isOpen) {
             this.view.close();
           } else {
             this.input.handleRevert();
-            this.input.endLayoutExtend(true);
           }
         }
         event.preventDefault();
         break;
       case KeyEvent.DOM_VK_RETURN:
         if (executeAction) {
           this.input.handleCommand(event);
         }
--- a/browser/components/urlbar/UrlbarInput.jsm
+++ b/browser/components/urlbar/UrlbarInput.jsm
@@ -1004,21 +1004,21 @@ class UrlbarInput {
       this.window.promiseDocumentFlushed(() => {
         this.window.requestAnimationFrame(() => {
           this.setAttribute("breakout-extend-animate", "true");
         });
       });
     }
   }
 
-  endLayoutExtend(force) {
+  endLayoutExtend() {
     if (
       !this.hasAttribute("breakout-extend") ||
       this.view.isOpen ||
-      (!force && this.getAttribute("focused") == "true")
+      this.getAttribute("focused") == "true"
     ) {
       return;
     }
     this.removeAttribute("breakout-extend");
     if (this._toolbar) {
       this._toolbar.removeAttribute("urlbar-exceeds-toolbar-bounds");
     }
   }
@@ -1741,20 +1741,21 @@ class UrlbarInput {
   _on_focus(event) {
     if (!this._hideFocus) {
       this.setAttribute("focused", "true");
     }
 
     // We handle mouse-based expansion events separately in _on_click.
     if (this._focusedViaMousedown) {
       this._focusedViaMousedown = false;
-    } else if (this.inputField.hasAttribute("refocused-by-panel")) {
-      this._maybeSelectAll(true);
     } else {
       this.startLayoutExtend();
+      if (this.inputField.hasAttribute("refocused-by-panel")) {
+        this._maybeSelectAll(true);
+      }
     }
 
     this._updateUrlTooltip();
     this.formatValue();
 
     // Hide popup notifications, to reduce visual noise.
     if (this.getAttribute("pageproxystate") != "valid") {
       this.window.UpdatePopupNotificationsVisibility();
@@ -1829,27 +1830,16 @@ class UrlbarInput {
 
         // Close the view when clicking on toolbars and other UI pieces that might
         // not automatically remove focus from the input.
         // Respect the autohide preference for easier inspecting/debugging via
         // the browser toolbox.
         if (!UrlbarPrefs.get("ui.popup.disable_autohide")) {
           this.view.close();
         }
-
-        if (
-          event.target.id == "tabs-newtab-button" ||
-          event.target.id == "new-tab-button" ||
-          event.target.classList.contains("tab-close-button")
-        ) {
-          break;
-        }
-
-        // We collapse the urlbar for any clicks outside of it.
-        this.endLayoutExtend(true);
     }
   }
 
   _on_input(event) {
     let value = this.value;
     this.valueIsTyped = true;
     this._untrimmedValue = value;
     this.window.gBrowser.userTypedValue = value;
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -372,17 +372,19 @@ notification[value="translation"] menuli
 #context_closeTab {
   list-style-image: url("moz-icon://stock/gtk-close?size=menu");
 }
 
 /* Tab drag and drop */
 .tab-drop-indicator {
   list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator.png);
   margin-bottom: -9px;
-  z-index: 3;
+  /* The z-index needs to be big enough to trump other positioned UI pieces
+     that we want to overlay. The expanded urlbar uses 3. */
+  z-index: 4;
 }
 
 /* All tabs menupopup */
 
 .alltabs-item[selected="true"] {
   font-weight: bold;
 }
 
--- a/browser/themes/osx/browser.css
+++ b/browser/themes/osx/browser.css
@@ -607,17 +607,19 @@
 
 .tab-drop-indicator-box {
   -moz-box-align: center;
 }
 
 .tab-drop-indicator {
   list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator.png);
   margin-top: -2px;
-  z-index: 3;
+  /* The z-index needs to be big enough to trump other positioned UI pieces
+     that we want to overlay. The expanded urlbar uses 3. */
+  z-index: 4;
 }
 
 @media (min-resolution: 2dppx) {
   .tab-drop-indicator {
     list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator@2x.png);
     width: 12px;
   }
 }
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -602,17 +602,19 @@ menuitem.bookmark-item {
   outline: 1px dotted;
   outline-offset: -6px;
 }
 
 /* Tab DnD indicator */
 .tab-drop-indicator {
   list-style-image: url(chrome://browser/skin/tabbrowser/tabDragIndicator.png);
   margin-bottom: -9px;
-  z-index: 3;
+  /* The z-index needs to be big enough to trump other positioned UI pieces
+     that we want to overlay. The expanded urlbar uses 3. */
+  z-index: 4;
 }
 
 /* All tabs menupopup */
 
 .alltabs-item[selected="true"] {
   font-weight: bold;
 }