News for hackers. Stuff that matters.
Re:Don't Animate Height by dotancohen on Tuesday July 22, 2025 @11:32PM (#44655491)

  > Just wrap it in a container with fixed height and "overflow: hidden".
That's a fix for a webdev who cares, not a fix for a browser vendor as GP was alluding to.
Re:Don't Animate Height by fiddlerwoaroof on Tuesday July 22, 2025 @11:52PM (#44655584)
I don't understand how you'd fix this, in general, for the browser: the browser can't just assume certain animations will never affect layout.
Re:Don't Animate Height by kadoban on Wednesday July 23, 2025 @04:23AM (#44656909)
It could _probably_ figure out a lot of cases via some kind of static or runtime analysis.

Like the example from the linked article, there's one animation involved essentially and if the browser does the hard work for the entire length of one animation cycle and no layout ever changes, just assume it never will? It would have to have a bunch of edge cases to handle correctly I'm sure though.

Re:Don't Animate Height by deepsun on Wednesday July 23, 2025 @03:56PM (#44663304)
Browsers layout engines are pretty smart, and also optimized for speed at the same time, which makes them very complex. I can do one or the other in my code, but both is too hard. Now add there security.

But Google having more people working on Chrome than on Android I would say all the low-hanging optimizations have already been optimized, and all that's left is pretty complex even for teams of thousands.