Description
What problem are you trying to solve?
When we need to frequently read some values from DOM Element, the browser will perform reflow, which is a very large performance consumption. For example, read scrollTop, getBoundingClientRect. I believe there are many scenarios that need to frequently read the changes of these values, but doing these now will affect performance.
Why not pre-store the value in Element when calculating the next frame inside the browser to avoid reflowing again when reading, so as to greatly improve performance?
If pre-storing the calculated value for each element will consume too many resources, then we can support a property to indicate that the specified element needs to pre-store the calculated value, which will greatly improve performance without wasting resources.
I temporarily think of using computed
. If there is a better proposal, please discuss it.
Activity