Backout changesets a8b5109c2a6c to 6281bc7f1bbf.
authorEdward Lee <edilee@mozilla.com>
Fri, 13 Aug 2010 21:51:48 -0700
changeset 50558 c14d91f2d939dd44580ac0e79802c9c5b029dd1d
parent 50538 6281bc7f1bbfd52c52ac8477f7d31e1a998fa215
child 50559 17f4064c1d23e04e8ee7be642e436a80a5fa3d6e
push id15073
push useredward.lee@engineering.uiuc.edu
push dateSat, 14 Aug 2010 04:53:00 +0000
treeherdermozilla-central@17f4064c1d23 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone2.0b4pre
backs outa8b5109c2a6c7b4ef188e0c55c5d883ccc3e5f1f
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
Backout changesets a8b5109c2a6c to 6281bc7f1bbf.
browser/base/content/browser-menubar.inc
browser/base/content/browser-tabview.js
browser/base/content/browser.xul
browser/base/content/tabbrowser.xml
browser/base/content/tabview/drag.js
browser/base/content/tabview/groupitems.js
browser/base/content/tabview/iq.js
browser/base/content/tabview/items.js
browser/base/content/tabview/tabview.css
browser/base/content/tabview/ui.js
browser/base/content/test/tabview/browser_tabview_launch.js
browser/locales/en-US/chrome/browser/browser.dtd
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -204,18 +204,18 @@
 #endif
               </menupopup>
             </menu>
 
             <menu id="view-menu" label="&viewMenu.label;"
                   accesskey="&viewMenu.accesskey;">
               <menupopup id="menu_viewPopup">
                 <menuitem id="menu_tabview"
-                          label="&showTabView2.label;"
-                          accesskey="&showTabView2.accesskey;"
+                          label="&showTabView.label;"
+                          accesskey="&showTabView.accesskey;"
                           command="Browser:ToggleTabView"/>
                 <menu id="viewToolbarsMenu"
                       label="&viewToolbarsMenu.label;"
                       accesskey="&viewToolbarsMenu.accesskey;">
                   <menupopup onpopupshowing="onViewToolbarsPopupShowing(event);">
                     <menuseparator/>
                     <menuitem id="menu_tabsOnTop"
                               command="cmd_ToggleTabsOnTop"
--- a/browser/base/content/browser-tabview.js
+++ b/browser/base/content/browser-tabview.js
@@ -41,17 +41,17 @@ let TabView = {
   _sessionstore: null,
   _visibilityID: "tabview-visibility",
   
   // ----------
   get windowTitle() {
     delete this.windowTitle;
     let brandBundle = document.getElementById("bundle_brand");
     let brandShortName = brandBundle.getString("brandShortName");
-    let title = gNavigatorBundle.getFormattedString("tabView2.title", [brandShortName]);
+    let title = gNavigatorBundle.getFormattedString("tabView.title", [brandShortName]);
     return this.windowTitle = title;
   },
 
   // ----------
   init: function TabView_init() {    
     // ___ keys    
     this._setBrowserKeyHandlers();
 
@@ -192,44 +192,18 @@ let TabView = {
       let charCode = event.charCode;
 #ifdef XP_MACOSX
       // if a text box in a webpage has the focus, the event.altKey would
       // return false so we are depending on the charCode here.
       if (!event.ctrlKey && !event.metaKey && !event.shiftKey &&
           charCode == 160) { // alt + space
 #else
       if (event.ctrlKey && !event.metaKey && !event.shiftKey &&
-          !event.altKey && charCode == 32) { // ctrl + space
+          event.altKey && charCode == 32) { // ctrl + alt + space
 #endif
-
-        // Don't handle this event if it's coming from a node that might allow
-        // multiple keyboard selection like selects or trees
-        let node = event.target;
-        switch (node.namespaceURI) {
-          case "http://www.w3.org/1999/xhtml":
-            // xhtml:select only allows multiple when the attr is set
-            if (node.localName == "select" && node.hasAttribute("multiple"))
-              return;
-            break;
-
-          case "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul":
-            switch (node.localName) {
-              case "listbox":
-                // xul:listbox is by default single
-                if (node.getAttribute("seltype") == "multiple")
-                  return;
-                break;
-              case "tree":
-                // xul:tree is by default multiple
-                if (node.getAttribute("seltype") != "single")
-                  return;
-                break;
-            }
-        }
-
         event.stopPropagation();
         event.preventDefault();
         self.show();
         return;
       }
 
       // Control (+ Shift) + `
       if (event.ctrlKey && !event.metaKey && !event.altKey &&
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -936,19 +936,19 @@
                      label="&listAllTabs.label;"
                      tooltiptext="&listAllTabs.label;"
                      removable="true">
         <menupopup id="alltabs-popup"
                    position="after_end"/>
       </toolbarbutton>
 
       <toolbarbutton id="tabview-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
-                     label="&tabViewButton2.label;"
+                     label="&tabViewButton.label;"
                      command="Browser:ToggleTabView"
-                     tooltiptext="&tabViewButton2.tooltip;"
+                     tooltiptext="&tabViewButton.tooltip;"
                      removable="true"/>
 
       <toolbarbutton id="tabs-closebutton"
                      class="close-button tabs-closebutton"
                      command="cmd_close"
                      label="&closeTab.label;"
                      tooltiptext="&closeTab.label;"/>
 
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -721,17 +721,17 @@
             return newTitle;
           ]]>
         </body>
       </method>
 
       <method name="updateTitlebar">
         <body>
           <![CDATA[
-            if (window.TabView && TabView.isVisible()) {
+            if (TabView && TabView.isVisible()) {
               // ToDo: this will be removed when we gain ability to draw to the menu bar.
               // Bug 586175
               this.ownerDocument.title = TabView.windowTitle;
             } else {
               this.ownerDocument.title = this.getWindowTitleForBrowser(this.mCurrentBrowser);
             }
           ]]>
         </body>
--- a/browser/base/content/tabview/drag.js
+++ b/browser/base/content/tabview/drag.js
@@ -103,18 +103,18 @@ Drag.prototype = {
   //   bounds             - (<Rect>) bounds
   //   stationaryCorner   - which corner is stationary? by default, the top left.
   //                        "topleft", "bottomleft", "topright", "bottomright"
   //   assumeConstantSize - (boolean) whether the bounds' dimensions are sacred or not.
   //   keepProportional   - (boolean) if assumeConstantSize is false, whether we should resize
   //                        proportionally or not
   //   checkItemStatus    - (boolean) make sure this is a valid item which should be snapped
   snapBounds: function Drag_snapBounds(bounds, stationaryCorner, assumeConstantSize, keepProportional, checkItemStatus) {
-    if (!stationaryCorner)
-      stationaryCorner || 'topleft';
+		if (!stationaryCorner)
+			stationaryCorner || 'topleft';
     var update = false; // need to update
     var updateX = false;
     var updateY = false;
     var newRect;
     var snappedTrenches = {};
 
     // OH SNAP!
 
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -121,23 +121,25 @@ let GroupItem = function GroupItem(listO
 
   this.isDragging = false;
   $container
     .css({zIndex: -100})
     .appendTo("body");
 
   // ___ New Tab Button
   this.$ntb = iQ("<div>")
+    .appendTo($container);
+
+  this.$ntb
     .addClass('newTabButton')
     .click(function() {
       self.newTab();
-    })
-    .attr('title',
-          "New tab")
-    .appendTo($container);
+    });
+
+  (this.$ntb)[0].title = 'New tab';
 
   // ___ Resizer
   this.$resizer = iQ("<div>")
     .addClass('resizer')
     .appendTo($container)
     .hide();
 
   // ___ Titlebar
@@ -162,17 +164,17 @@ let GroupItem = function GroupItem(listO
       self.closeAll();
     })
     .appendTo($container);
 
   // ___ Title
   this.$titleContainer = iQ('.title-container', this.$titlebar);
   this.$title = iQ('.name', this.$titlebar);
   this.$titleShield = iQ('.title-shield', this.$titlebar);
-  this.setTitle(options.title || this.defaultName);
+  this.setTitle(options.title || "");
 
   var titleUnfocus = function() {
     self.$titleShield.show();
     if (!self.getTitle()) {
       self.$title
         .addClass("defaultName")
         .val(self.defaultName);
     } else {
@@ -291,17 +293,17 @@ let GroupItem = function GroupItem(listO
   }
 };
 
 // ----------
 window.GroupItem.prototype = Utils.extend(new Item(), new Subscribable(), {
   // ----------
   // Variable: defaultName
   // The prompt text for the title field.
-  defaultName: "Name this tab group…",
+  defaultName: "name this groupItem...",
 
   // -----------
   // Function: setActiveTab
   // Sets the active <TabItem> for this groupItem
   setActiveTab: function(tab) {
     Utils.assert(tab && tab.isATabItem, 'tab must be a TabItem');
     this._activeTab = tab;
   },
@@ -367,17 +369,17 @@ window.GroupItem.prototype = Utils.exten
   },
 
   // ----------
   // Function: adjustTitleSize
   // Used to adjust the width of the title box depending on groupItem width and title size.
   adjustTitleSize: function() {
     Utils.assert(this.bounds, 'bounds needs to have been set');
     let closeButton = iQ('.close', this.container);
-    var w = Math.min(this.bounds.width - parseInt(closeButton.width()) - parseInt(closeButton.css('right')),
+    var w = Math.min(this.bounds.width - closeButton.width() - closeButton.css('right'),
                      Math.max(150, this.getTitle().length * 6));
     // The * 6 multiplier calculation is assuming that characters in the title
     // are approximately 6 pixels wide. Bug 586545
     var css = {width: w};
     this.$title.css(css);
     this.$titleShield.css(css);
   },
 
@@ -648,20 +650,17 @@ window.GroupItem.prototype = Utils.exten
         if (typeof item.setResizable == 'function')
           item.setResizable(false);
 
         if (item.tab == gBrowser.selectedTab)
           GroupItems.setActiveGroupItem(this);
       }
 
       if (!options.dontArrange) {
-        // by default, we animate the item moving to its new position
-        let animate = typeof options.animate == "undefined" ? true :
-                      options.animate;
-        this.arrange({ animate: animate });
+        this.arrange();
       }
       UI.setReorderTabsOnHide(this);
 
       if (this._nextNewTabCallback) {
         this._nextNewTabCallback.apply(this, [item])
         this._nextNewTabCallback = null;
       }
     } catch(e) {
@@ -1793,17 +1792,16 @@ window.GroupItems = {
       UI.showTabView();
     }
   },
 
   // ----------
   // Function: killNewTabGroup
   // Removes the New Tab Group, which is now defunct. See bug 575851 and comments therein.
   killNewTabGroup: function() {
-    let newTabGroupTitle = "New Tabs";
     this.groupItems.forEach(function(groupItem) {
-      if (groupItem.getTitle() == newTabGroupTitle && groupItem.locked.title) {
+      if (groupItem.getTitle() == 'New Tabs' && groupItem.locked.title) {
         groupItem.removeAll();
         groupItem.close();
       }
     });
   }
 };
--- a/browser/base/content/tabview/iq.js
+++ b/browser/base/content/tabview/iq.js
@@ -526,17 +526,19 @@ iQClass.prototype = {
   //     in, but "this" is set to the element that was animated.
   animate: function(css, options) {
     Utils.assert(this.length == 1, 'does not yet support multi-objects (or null objects)');
 
     if (!options)
       options = {};
 
     let easings = {
-      tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.29)", 
+      tabviewBounce: "cubic-bezier(0.0, 0.63, .6, 1.0)", 
+      // TODO: change 1.0 above to 1.29 after bug 575672 is fixed
+      
       easeInQuad: 'ease-in', // TODO: make it a real easeInQuad, or decide we don't care
       fast: 'cubic-bezier(0.7,0,1,1)'
     };
 
     let duration = (options.duration || 400);
     let easing = (easings[options.easing] || 'ease');
 
     // The latest versions of Firefox do not animate from a non-explicitly
--- a/browser/base/content/tabview/items.js
+++ b/browser/base/content/tabview/items.js
@@ -1043,17 +1043,17 @@ window.Items = {
         var blocked = false;
         pairs.forEach(function(pair2) {
           if (pair2 == pair || pair2.item == ignore)
             return;
 
           var bounds2 = pair2.bounds;
           if (bounds2.intersects(newBounds))
             blocked = true;
-          return;
+					return;
         });
 
         if (!blocked) {
           pair.bounds.copy(newBounds);
         }
       }
       return;
     });
--- a/browser/base/content/tabview/tabview.css
+++ b/browser/base/content/tabview/tabview.css
@@ -342,36 +342,36 @@ input.name {
   border: 1px solid transparent;
   color: #999;
   margin: 3px 0px 0px 3px;
   padding: 1px;
   background-image: url(chrome://browser/skin/tabview/edit-light.png);
   padding-left: 20px;
 }
 
-.title-container:hover input.name {
+input.name:hover {
   border: 1px solid #ddd;
 }
 
-.title-container:hover input.name-locked {
+input.name-locked:hover {
   border: 1px solid transparent !important;
   cursor: default;
 }
 
 input.name:focus {
   color: #555;
 }
 
 input.defaultName {
   font-style: italic !important;
   background-image-opacity: .1;
   color: transparent;
 }
 
-.title-container:hover input.defaultName {
+input.defaultName:hover {
   color: #CCC;
 }
 
 .title-container {
   cursor: text;
 }
 
 .title-shield {
--- a/browser/base/content/tabview/ui.js
+++ b/browser/base/content/tabview/ui.js
@@ -102,22 +102,17 @@ var UIManager = {
       gWindow.addEventListener("tabviewshow", function() {
         self.showTabView(true);
       }, false);
 
       // ___ currentTab
       this._currentTab = gBrowser.selectedTab;
 
       // ___ Dev Menu
-      // This dev menu is not meant for shipping, nor is it of general
-      // interest, but we still need it for the time being. Change the 
-      // false below to enable; just remember to change back before 
-      // committing. Bug 586721 will track the ultimate removal. 
-      if (false)
-        this._addDevMenu();
+      this._addDevMenu();
 
       // When you click on the background/empty part of TabView,
       // we create a new groupItem.
       iQ(gTabViewFrame.contentDocument).mousedown(function(e) {
         if (iQ(":focus").length > 0) {
           iQ(":focus").each(function(element) {
             if (element.nodeName == "INPUT")
               element.blur();
@@ -153,20 +148,16 @@ var UIManager = {
       GroupItems.init();
 
       var groupItemsData = Storage.readGroupItemsData(gWindow);
       var firstTime = !groupItemsData || Utils.isEmptyObject(groupItemsData);
       var groupItemData = Storage.readGroupItemData(gWindow);
       GroupItems.reconstitute(groupItemsData, groupItemData);
       GroupItems.killNewTabGroup(); // temporary?
 
-      // ___ tabs
-      TabItems.init();
-      TabItems.pausePainting();
-
       if (firstTime) {
         var padding = 10;
         var infoWidth = 350;
         var infoHeight = 350;
         var pageBounds = Items.getPageBounds();
         pageBounds.inset(padding, padding);
 
         // ___ make a fresh groupItem
@@ -180,38 +171,39 @@ var UIManager = {
 
         var groupItem = new GroupItem([], options);
 
         var items = TabItems.getItems();
         items.forEach(function(item) {
           if (item.parent)
             item.parent.remove(item);
 
-          groupItem.add(item, null, {animate: false});
+          groupItem.add(item);
         });
 
         // ___ make info item
-        let welcome = "How to organize your tabs";
-        let more = "";
-        let video = "http://videos-cdn.mozilla.net/firefox4beta/tabcandy_howto.webm";
         var html =
           "<div class='intro'>"
-            + "<h1>" + welcome + "</h1>"
-            + ( more && more.length ? "<div>" + more + "</div><br>" : "")
-            + "<video src='" + video + "' "
+            + "<h1>Welcome to Firefox Tab Sets</h1>" // TODO: This needs to be localized if it's kept in
+            + "<div>(more goes here)</div><br>"
+            + "<video src='http://people.mozilla.org/~araskin/movies/tabcandy_howto.webm' "
             + "width='100%' preload controls>"
           + "</div>";
 
         box.left = box.right + padding;
         box.width = infoWidth;
         box.height = infoHeight;
         var infoItem = new InfoItem(box);
         infoItem.html(html);
       }
 
+      // ___ tabs
+      TabItems.init();
+      TabItems.pausePainting();
+
       // ___ resizing
       if (this._pageBounds)
         this._resize(true);
       else
         this._pageBounds = Items.getPageBounds();
 
       iQ(window).resize(function() {
         self._resize();
@@ -307,17 +299,17 @@ var UIManager = {
 
     this._reorderTabItemsOnShow.forEach(function(groupItem) {
       groupItem.reorderTabItemsBasedOnTabOrder();
     });
     this._reorderTabItemsOnShow = [];
 
 #ifdef XP_WIN
     // Restore the full height when showing TabView
-    gTabViewFrame.style.marginTop = "22px";
+    gTabViewFrame.style.marginTop = 0;
 #endif
     gTabViewDeck.selectedIndex = 1;
     gTabViewFrame.contentWindow.focus();
 
     gBrowser.updateTitlebar();
 #ifdef XP_MACOSX
     this._setActiveTitleColor(true);
 #endif
@@ -435,16 +427,24 @@ var UIManager = {
               (groupItem == null && gBrowser.visibleTabs.length == 1)) {
             // for the tab focus event to pick up.
             self._closedLastVisibleTab = true;
             // remove the zoom prep.
             if (tab && tab.tabItem)
               tab.tabItem.setZoomPrep(false);
             self.showTabView();
           }
+          // ToDo: When running unit tests, everything happens so quick so
+          // new tabs might be added after a tab is closing. Therefore, this
+          // hack is used. We should look for a better solution.
+          setTimeout(function() { // Marshal event from chrome thread to DOM thread
+            if ((groupItem && groupItem._children.length > 0) ||
+              (groupItem == null && gBrowser.visibleTabs.length > 0))
+              self.hideTabView();
+          }, 1);
         }
       }
     });
 
     AllTabs.register("move", function(tab) {
       if (tab.ownerDocument.defaultView != gWindow)
         return;
 
@@ -631,17 +631,17 @@ var UIManager = {
         event.preventDefault();
       } else if (event.which == 32) {
         // alt/control + space to zoom into the active tab.
 #ifdef XP_MACOSX
         if (event.altKey && !event.metaKey && !event.shiftKey &&
             !event.ctrlKey) {
 #else
         if (event.ctrlKey && !event.metaKey && !event.shiftKey &&
-            !event.altKey) {
+            event.altKey) {
 #endif
           var activeTab = self.getActiveTab();
           if (activeTab)
             activeTab.zoomIn();
           event.stopPropagation();
           event.preventDefault();
         }
       } else if (event.which == 27 || event.which == 13) {
--- a/browser/base/content/test/tabview/browser_tabview_launch.js
+++ b/browser/base/content/test/tabview/browser_tabview_launch.js
@@ -51,17 +51,17 @@ function test() {
         var keyCode = 0;
         var charCode;
         var eventObject;
         if (navigator.platform.indexOf("Mac") != -1) {
           charCode = 160;
           eventObject = { altKey: true };
         } else {
           charCode = 32;
-          eventObject = { ctrlKey: true };
+          eventObject = { altKey: true, ctrlKey: true };
         }
         var modifiers = EventUtils._parseModifiers(eventObject);
         var keyDownDefaultHappened =
             utils.sendKeyEvent("keydown", keyCode, charCode, modifiers);
         utils.sendKeyEvent("keypress", keyCode, charCode, modifiers,
                              !keyDownDefaultHappened);
         utils.sendKeyEvent("keyup", keyCode, charCode, modifiers);
       }
--- a/browser/locales/en-US/chrome/browser/browser.dtd
+++ b/browser/locales/en-US/chrome/browser/browser.dtd
@@ -127,18 +127,18 @@
 <!ENTITY backForwardItem.title        "Back/Forward">
 <!ENTITY locationItem.title           "Location">
 <!ENTITY searchItem.title             "Search">
 <!ENTITY throbberItem.title           "Activity Indicator">
 <!ENTITY bookmarksItem.title          "Bookmarks">
 
 <!-- Toolbar items --> 
 <!ENTITY  homeButton.label            "Home">
-<!ENTITY tabViewButton2.label         "Tab Groups">
-<!ENTITY tabViewButton2.tooltip       "Group Your Tabs">
+<!ENTITY tabViewButton.label          "Tab Sets">
+<!ENTITY tabViewButton.tooltip        "Open a visual tab interface">
 
 <!ENTITY bookmarksButton.label          "Bookmarks">
 <!ENTITY bookmarksButton.tooltip        "Display your bookmarks">
 <!ENTITY bookmarksButton.accesskey  "B">
 <!ENTITY bookmarksCmd.commandkey "b">
 
 <!ENTITY bookmarksMenuButton.label          "Bookmarks">
 <!ENTITY bookmarksMenuButton.tooltip        "Display your bookmarks">
@@ -235,18 +235,18 @@
 <!ENTITY privateBrowsingCmd.start.label         "Start Private Browsing">
 <!ENTITY privateBrowsingCmd.start.accesskey     "P">
 <!ENTITY privateBrowsingCmd.stop.label          "Stop Private Browsing">
 <!ENTITY privateBrowsingCmd.stop.accesskey      "P">
 <!ENTITY privateBrowsingCmd.commandkey          "P">
 
 <!ENTITY viewMenu.label         "View"> 
 <!ENTITY viewMenu.accesskey       "V"> 
-<!ENTITY showTabView2.label     "Group Your Tabs…">
-<!ENTITY showTabView2.accesskey     "G">
+<!ENTITY showTabView.label     "TabView">
+<!ENTITY showTabView.accesskey     "V">
 <!ENTITY viewToolbarsMenu.label       "Toolbars"> 
 <!ENTITY viewToolbarsMenu.accesskey     "T"> 
 <!ENTITY viewSidebarMenu.label "Sidebar">
 <!ENTITY viewSidebarMenu.accesskey "e">
 <!ENTITY viewCustomizeToolbar.label       "Customize…"> 
 <!ENTITY viewCustomizeToolbar.accesskey     "C">
 <!ENTITY viewTabsOnTop.label            "Tabs on Top">
 <!ENTITY viewTabsOnTop.accesskey        "T">
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -271,12 +271,12 @@ privateBrowsingNeverAsk=&Do not show thi
 # See: http://developer.mozilla.org/en/docs/Localization_and_Plurals
 ctrlTab.showAll.label=;Show all #1 tabs
 
 # LOCALIZATION NOTE (addKeywordTitleAutoFill): %S will be replaced by the page's title
 # Used as the bookmark name when saving a keyword for a search field.
 addKeywordTitleAutoFill=Search %S
 
 # TabView
-tabView2.title=%S - Group Your Tabs
+tabView.title=%S Tab Sets
 
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
 extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.