4 ms·
Style properties such as transforms can be changed at runtime by JavaScript (and frequently are for things like dragging operations). There is no practical way
by ender7 12y ago
Style properties such as transforms can be changed at runtime by JavaScript (and frequently are for things like dragging operations). There is no practical way for the profiler to detect which styles of which elements your JavaScript will attempt to modify.
- Smudge 12y agoIn such cases -- where it is JavaScript's responsibility to mutate the CSS at runtime -- it seems like the 'will-change' property should also be added/activated using JS. However, most of the CSS transforms I write are pre-defined in the CSS and activated by simply adding/removing classes using JS. This seems like something the browser should be perfectly capable of predicting without my help, since the JS isn't actually mutating the CSS.
- ender7 12y agoThis reduces to the same problem mentioned above (which is essentially the halting problem). The browser has no way of predicting which elements you will add or remove these classes from. Automatic preparation would be possible for transforms/animations that are applied in pseudo selectors such as :hover, but not in any other cases.