+ A work-around for supporting transitions to and from 'auto' values of left, top, width, height, etc.
authorAza Raskin <aza@mozilla.com>
Thu, 10 Jun 2010 14:35:15 -0700
changeset 49956 afc616627f435b37148548bac7519f82ad11e688
parent 49955 fa318bc70da99d583a747b98f474ce7e41d8ebc9
child 49960 cc84ad26b4b37e2d5c2d952c41339e6723dfaa53
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)
bugs571344
+ A work-around for supporting transitions to and from 'auto' values of left, top, width, height, etc. + For more details see: https://bugzilla.mozilla.org/show_bug.cgi?id=571344
browser/base/content/tabcandy/core/iq.js
--- a/browser/base/content/tabcandy/core/iq.js
+++ b/browser/base/content/tabcandy/core/iq.js
@@ -607,16 +607,29 @@ iQ.fn = iQ.prototype = {
       var easings = {
         tabcandyBounce: 'cubic-bezier(0.0, 0.63, .6, 1.29)', 
         easeInQuad: 'ease-in' // TODO: make it a real easeInQuad, or decide we don't care
       };
       
       var duration = (options.duration || 400);
       var easing = (easings[options.easing] || 'ease');
 
+      // The latest versions of Firefox do not animate from a non-explicitly set
+      // css properties. So for each element to be animated, go through and
+      // explicitly define 'em.
+      rupper = /([A-Z])/g;    
+      this.each(function(){
+        var cStyle = window.getComputedStyle(this, null);      
+        for(var prop in css){
+          prop = prop.replace( rupper, "-$1" ).toLowerCase();
+          iQ(this).css(prop, cStyle.getPropertyValue(prop));
+        }    
+      });
+
+
       this.css({
         '-moz-transition-property': 'all', // TODO: just animate the properties we're changing  
         '-moz-transition-duration': (duration / 1000) + 's',  
         '-moz-transition-timing-function': easing
       });
 
       this.css(css);