Just wrap it in a container with fixed height and "overflow: hidden". Now the layout engine knows that it doesn't need to recalculate positions of elements outside that wrapper, and it's much faster. By the way, the same trick was speeding up large rendering back in the day. As long as you know the size of your rows or columns ahead of time, which kinda defeats the purpose of .
Translation: just make a completely different functionality and effect than what was originally intended because the DOM can only handle static content, barely.
Don't animate height
221–230 of 276 posts
Re: Don't animate height
#222Re: Don't animate height
#223Is it possible to restrict this as a user? Like to force webpages to use under a certain amount of render/paint time/resources or else just break so that one dumb tab doesn't use up all my battery? Then I can opt-in to greater resources usage if it's a webpage I actually care about. I've seen the "This webpage is using alot of resources" popup before but I don't think it would happen in this case. Because honestly I…
Quite unreliable and more a joke than anything, of course...
Re: Don't animate height
#224Re: Don't animate height
#225Earlier quoted context omitted.
As an old-school webguy, fixes like this article make me sad. The average front-end person these days has so little respect for the DOM and then gets mystified about why the McMaster-Carr website is so good despite being build with ancient practices.
I just went to the McMaster-Carr home page and right-clicked for "View Page Source". There's a LOT of code there.
Re: Don't animate height
#226Earlier quoted context omitted.
100% of the CPU for 5 seconds seems unreasonably long for a random webpage.
For a news article, absolutely. But I think it needs to be able to handle JavaScript-heavy webapps too. My suggestion wasn't really about promoting maximum best practices, but just avoiding total runaway excess.
Websites don't need that much resources and should be optimized.... if somehow web developers could read, maybe they'd start doing that.
Re: Don't animate height
#227Earlier quoted context omitted.
No css at all is pretty extreme, but I'd be on board with disabling css animations
That's very very sad. Animations can make UX much better when used correctly.
Re: Don't animate height
#228Earlier quoted context omitted.
As an old-school webguy, fixes like this article make me sad. The average front-end person these days has so little respect for the DOM and then gets mystified about why the McMaster-Carr website is so good despite being build with ancient practices.
Well, and especially because the “fixed” version is still - if I’ve read correctly - consuming 12% CPU before any user interaction on a page that’s otherwise substantially a plain or possibly RTFish text editor. How is that considered acceptable? It’s still going to drain the battery faster than is justified, even if at a somewhat reduced rate from the pre-fixed case. The acceptable range would be something like 0 -…