3 ms·
You misread my quote entirely. If you read further down the article you're referencing (davidwalsh.name/css-js-animation), you'll see an example of how Velocit
by purpleturtle 12y ago
You misread my quote entirely.
If you read further down the article you're referencing (davidwalsh.name/css-js-animation), you'll see an example of how Velocity caches values between consecutively chained calls. THAT is an example of the browser not knowing when to optimize transitions in sync with JS code. Another example from that same article: Caching unit conversion ratios (e.g. px to %, em, etc.) across sibling elements in the same call.
Further, JS animation does not eat up mobile devices. You're conflating concepts.
I know that HN can be a stomping grounds, but there's no need to be rude.
- goldenkey 12y agoCaching values is an obvious and necessary optimization. The claim that the CSS transition cannot know when the property changes due to JS, therefore cannot optimize, is total fluffery. The main loop is render, JS, and never at the same time. That is why a JS loop will freeze the browser. Have you no idea that it's all single threaded?