Bug 644097 - favicon is misplaced when resizing a stacked group [f=raymond, r=ian]
authorTim Taubert <tim.taubert@gmx.de>
Fri, 08 Apr 2011 11:23:26 -0700
changeset 67719 ee41fa88ae5462c1d1a8230379eaa8bb3209cc13
parent 67718 ca93335759fc8329cec2ed181be1e5cb61f6a49b
child 67720 6281e1a3c11e868c4856a69af0d402e954a0e719
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersian
bugs644097
milestone2.2a1pre
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 644097 - favicon is misplaced when resizing a stacked group [f=raymond, r=ian]
browser/base/content/tabview/groupitems.js
browser/base/content/test/tabview/Makefile.in
browser/base/content/test/tabview/browser_tabview_bug644097.js
browser/base/content/test/tabview/test_bug644097.html
--- a/browser/base/content/tabview/groupitems.js
+++ b/browser/base/content/tabview/groupitems.js
@@ -1418,30 +1418,30 @@ GroupItem.prototype = Utils.extend(new I
       child.isStacked = true;
       if (numInPile-- > 0) {
         children.push(child);
       } else {
         child.setHidden(true);
       }
     });
 
+    self._isStacked = true;
+
     let angleAccum = 0;
     children.forEach(function GroupItem__stackArrange_apply(child, index) {
       child.setZ(zIndex);
       zIndex--;
 
       // Force a recalculation of height because we've changed how the title
       // is shown.
       child.setBounds(box, !animate || child.getHidden(), {force:true});
       child.setRotation((UI.rtl ? -1 : 1) * angleAccum);
       child.setHidden(false);
       angleAccum += angleDelta;
     });
-
-    self._isStacked = true;
   },
   
   // ----------
   // Function: _gridArrange
   // Arranges the children into a grid.
   //
   // Parameters:
   //   childrenToArrange - array of <TabItem> children
--- a/browser/base/content/test/tabview/Makefile.in
+++ b/browser/base/content/test/tabview/Makefile.in
@@ -122,16 +122,17 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_bug631752.js \
                  browser_tabview_bug633788.js \
                  browser_tabview_bug634077.js \
                  browser_tabview_bug634085.js \
                  browser_tabview_bug634158.js \
                  browser_tabview_bug634672.js \
                  browser_tabview_bug635696.js \
                  browser_tabview_bug641802.js \
+                 browser_tabview_bug644097.js \
                  browser_tabview_bug645653.js \
                  browser_tabview_dragdrop.js \
                  browser_tabview_exit_button.js \
                  browser_tabview_expander.js \
                  browser_tabview_firstrun_pref.js \
                  browser_tabview_group.js \
                  browser_tabview_launch.js \
                  browser_tabview_multiwindow_search.js \
@@ -143,12 +144,13 @@ include $(topsrcdir)/config/rules.mk
                  browser_tabview_startup_transitions.js \
                  browser_tabview_undo_group.js \
                  dummy_page.html \
                  head.js \
                  search1.html \
                  search2.html \
                  test_bug599626.html \
                  test_bug600645.html \
+                 test_bug644097.html \
                  $(NULL)
 
 libs::	$(_BROWSER_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/browser_tabview_bug644097.js
@@ -0,0 +1,40 @@
+/* Any copyright is dedicated to the Public Domain.
+   http://creativecommons.org/publicdomain/zero/1.0/ */
+
+function test() {
+  waitForExplicitFinish();
+
+  newWindowWithTabView(function (win) {
+    registerCleanupFunction(function () win.close());
+
+    let cw = win.TabView.getContentWindow();
+    let groupItem = cw.GroupItems.groupItems[0];
+
+    // create some tabs with favIcons
+    for (let i = 0; i < 3; i++)
+      win.gBrowser.loadOneTab("http://mochi.test:8888/browser/browser/base/content/test/tabview/test_bug644097.html", {inBackground: true});
+
+    win.gBrowser.removeTab(win.gBrowser.tabs[0]);
+
+    // shrink the group until it stacks
+    let size = 400;
+    while (!groupItem.isStacked() && --size)
+      groupItem.setSize(size, size, true);
+
+    // determine the tabItem at the top of the stack
+    let tabItem;
+    groupItem.getChildren().forEach(function (item) {
+      if (groupItem.isTopOfStack(item))
+        tabItem = item;
+    });
+
+    ok(tabItem, "we found the tabItem at the top of the stack");
+
+    let fav = tabItem.$fav;
+    is(fav.css("display"), "block", "the favIcon is visible");
+    is(fav.css("left"), "0px", "the favIcon is at the left-most position");
+    is(fav.css("top"), "0px", "the favIcon is at the top-most position");
+
+    finish();
+  });
+}
new file mode 100644
--- /dev/null
+++ b/browser/base/content/test/tabview/test_bug644097.html
@@ -0,0 +1,8 @@
+<html>
+  <head>
+    <title>Bug 644097</title>
+    <link rel="icon" type="image/png" id="favicon" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8%2F9hAAAACGFjVEwAAAASAAAAAJNtBPIAAAAaZmNUTAAAAAAAAAAQAAAAEAAAAAAAAAAALuAD6AABhIDeugAAALhJREFUOI2Nk8sNxCAMRDlGohauXFOMpfTiAlxICqAELltHLqlgctg1InzMRhpFAc%2BLGWTnmoeZYamt78zXdZmaQtQMADlnU0OIAlbmJUBEcO4bRKQY2rUXIPmAGnDuG%2FBx3%2FfvOPVaDUg%2BoAPUf1PArIMCSD5glMEsUGaG%2BkyAFWIBaCsKuA%2BHGCNijLgP133XgOEtaPFMy2vUolEGJoCIzBmoRUR9%2B7rxj16DZaW%2FmgtmxnJ8V3oAnApQwNS5zpcAAAAaZmNUTAAAAAEAAAAQAAAAEAAAAAAAAAAAAB4D6AIB52fclgAAACpmZEFUAAAAAjiNY2AYBVhBc3Pzf2LEcGreqcbwH1kDNjHauWAUjAJyAADymxf9WF%2Bu8QAAABpmY1RMAAAAAwAAABAAAAAQAAAAAAAAAAAAHgPoAgEK8Q9%2FAAAAFmZkQVQAAAAEOI1jYBgFo2AUjAIIAAAEEAAB0xIn4wAAABpmY1RMAAAABQAAABAAAAAQAAAAAAAAAAAAHgPoAgHnO30FAAAAQGZkQVQAAAAGOI1jYBieYKcaw39ixHCC%2F6cwFWMTw2rz%2F1MM%2F6Vu%2Ff%2F%2F%2FxTD%2F51qEIwuRjsXILuEGLFRMApgAADhNCsVfozYcAAAABpmY1RMAAAABwAAABAAAAAQAAAAA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