madrobby/zepto — pull request #586 by mislav (2012-09-11 20:16:14+00:00)
Title: another stab at fixing animate() for elements just added to DOM

@madrobby, I want you to take a look at this.

Activating CSS transitions for an element just added to the DOM won't work in either Webkit or Mozilla. To work around this, we used to defer setting CSS properties with setTimeout (see 272513b05ce1f2e6bc4bf3d5a7cbe4a936bf7b56).

This solved the problem for Webkit, but not for latest versions of Firefox. Mozilla seems to need at least 15ms timeout, and even this value varies.

A better solution for both engines is to trigger "layout". This is done here by reading `clientLeft` from an element.