3 ms·
> I’m calling it a pathological case because it’s forcing style recalculation and layout ten times per frame It's only pathological because the web makes it pa
by dmitriid 5y ago
> I’m calling it a pathological case because it’s forcing style recalculation and layout ten times per frame
It's only pathological because the web makes it pathological. Phones routinely do complex layout animations that are unimaginable on the web. And yet, "we're doing layout calculations on ten emojis, it's pathological" is the norm on the web.
> t’s decidedly rare to want to animate more than one or perhaps two such element at a time
Yes. It's rare on the web. Because the web is unbelievably inefficient and slow when it comes to any animations beyond a very limited subset.
> And alternatives to the web are normally not actually going to be better—the web has had an insane amount of effort put into making something not particularly amenable to good performance
I have no idea where this verifiably false mindset comes from. Anyone you ask is "yes, the web is very performant, you can't do better, the alternatives can't be better". And yet you use apps, and frameworks, and approaches that are magnitudes faster, more performant, and create significantly more complex interactions and layouts than the web could ever hope to achieve.
Yes. I'm talking about your phone. I'm talking about your desktop. Right now my iPhone screen with two notifications displays more animations, at a smoother framerate than your "pathological example".
The supercomputers in our pockets and on our desks can output this: https://www.youtube.com/watch?v=EFyWEMe27Dw https://www.youtube.com/watch?v=EFyWEMe27Dw And yet, "it's rare to animate more than two things, other cases are pathological, I doubt anything else can perform better". You're talking about performance available to 1984 Macintosh https://www.youtube.com/watch?v=2B-XwPjn9YY https://www.youtube.com/watch?v=2B-XwPjn9YY
> Anyway, take my ten emoji example and reduce it to no layout dependencies (the usual case)
Ah yes. The usual case. That's why it's still impossible to animate height: auto, or an item being removed from a list without complex hacks because on the web everything simple is hard beyond all reasoning, and everything hard is impossible.