On the problem of opacity triggering paint

   

has been promoted to a composite layer with translteZ. Changing opacity still triggers paint, which is why it seems to be a little inconsistent with cognition

.
May.09,2022

The change of

transparency value will not cause paint, but from opacity: 1; to opacity: 0; is not as simple as numerical change, there is a relationship between transparency and non-transparency, which is a big gap. If you think about it, assuming that the page does not have a line of js code, then js parsing, the implementation of this process will not happen at all, we can do optimization, directly do not even load the js engine. So, the gap from scratch and from 1 to 100 is not just a numerical change.

if you initially set the initial value of opacity to 0.9, and then change it to 0 through js, you will find that the paint event disappears.

Menu