3 ms·
> One more quick tip: unlike box-shadow, the filter property is hardware-accelerated in Chrome, and possibly other browsers. In Firefox, everything is hardware
by chrismorgan 5y ago
> One more quick tip: unlike box-shadow, the filter property is hardware-accelerated in Chrome, and possibly other browsers.
In Firefox, everything is hardware-accelerated. And the `will-change` property is largely obsolete. (I personally wish they had stuck to the old translateZ(0) hack which was obviously a hack rather than defining will-change, since WebRender—what lets Firefox do all the rendering on the GPU—was already well underway and had demonstrated that something like will-change wasn’t necessary, though it was still a few more years before it was stabilised in Firefox.)
- kevingadd 5y agoWhile I generally agree, even in a hardware accelerated world will-change can still be useful. If you're transforming a complex box with lots of typeset international text and stuff in it, it can be necessary to buffer that whole box to a scratch surface first, so will-change is useful to optimize that.
- chrismorgan 5y agoBut does will-change do that? I would think what you describe would be a pessimisation in many (perhaps most) cases. (I haven’t the foggiest idea and my guess is wild rather than educated. I would like to be informed.)
- kevingadd 5y agoIt's a hint, so it has no (afaik) spec-required behavior. Whether it does that is up to the browser vendor and could depend on your device configuration. The MDN guidance says not to use it unless absolutely necessary, which I agree with - but it was added to solve a real problem on certain browser engines (and the problem can be way worse on mobile.)