+ merge
authorIan Gilman <ian@iangilman.com>
Thu, 10 Jun 2010 14:05:08 -0700
changeset 49958 2f67480ece3524d88968abe0a0c01e0896bd645f
parent 49957 3171d50d9a31a126eda136e9db8572d8b1d03cb3 (current diff)
parent 49955 fa318bc70da99d583a747b98f474ce7e41d8ebc9 (diff)
child 49959 dad42a0ceffbc009042a5b685244d27f73201530
push id15039
push useredward.lee@engineering.uiuc.edu
push dateThu, 12 Aug 2010 19:47:36 +0000
treeherdermozilla-central@5da28c582cc7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
+ merge
browser/base/content/tabcandy/app/ui.js
--- a/browser/base/content/tabcandy/app/ui.js
+++ b/browser/base/content/tabcandy/app/ui.js
@@ -284,21 +284,25 @@ window.Page = {
         }
       }, 1);
 
       return false;
     });
     
     Tabs.onFocus(function() {
       var focusTab = this;
+      
+      var sTime = (new Date()).getTime();
+      Utils.log("Tabcandy got focus. Timer starter:", sTime);
 
       // If we switched to TabCandy window...
       if( focusTab.contentWindow == window ){
         UI.focused = true;
         Page.hideChrome();
+        Utils.log("Chrome Hidden. Elapsed time:", (new Date()).getTime()-sTime);
         var currentTab = UI.currentTab;
         if(currentTab != null && currentTab.mirror != null) {
           // If there was a previous currentTab we want to animate
           // its mirror for the zoom out.
           
           // Zoom out!
           var mirror = currentTab.mirror;
           var $tab = iQ(mirror.el);
@@ -321,24 +325,33 @@ window.Page = {
           TabMirror.pausePainting();
           $tab.css({
               top: 0, left: 0,
               width: window.innerWidth,
               height: h * (window.innerWidth/w),
               zIndex: 999999,
               '-moz-transform': 'rotate(0deg)'
           });
+          Utils.log("Tab CSS set. Elapsed time:", (new Date()).getTime()-sTime);
           
           iQ.timeout(function() { // Marshal event from chrome thread to DOM thread
+            // Note that it is the marshalling that is causing a near 200ms delay between
+            // showing the tab and starting the animation which causes a big ugly jump.
+            // TODO: WE NEED A BETTER SOLUTION.
+            Utils.log("Start animation elapsed time:", (new Date()).getTime()-sTime);
+            var animStart = (new Date()).getTime();
             $tab.animate({
               top: pos.top, left: pos.left,
               width: w, height: h
             }, {
               duration: 350,
               complete: function() { 
+                // TODO:
+                // This never seems to actually take 350ms?
+                Utils.log("350ms animation took (in ms)", (new Date()).getTime()-animStart);              
                 $tab.css({
                   zIndex: z,
                   '-moz-transform': transform
                 });
                 iQ("body").css("overflow", overflow);
                 var activeGroup = Groups.getActiveGroup();
                 if( activeGroup ) activeGroup.reorderBasedOnTabOrder(item);