1. When some (or all) of the render tree are changed due to the size, layout, and hiding of the elements, they need to be rebuilt. This is
It is called reflux (in fact, I think it is simpler and clearer to relay the layout ). Each page requires at least one backflow, that is, the first addition
. 2. When some elements in the render tree need to update attributes, these attributes only affect the appearance and style of elements.
Without affecting the layout, such as background-color. This is called repainting. Note: It can be seen from the above that reflux is bound
This may cause re-painting, but re-painting may not necessarily cause backflow.
In fact, any operation on the elements in the render tree will cause reflux or re-painting. For example:
1. add and delete elements (reflux + re-painting)
2. Hide elements, display: none (reflux + re-painting), visibility: hidden (only re-painting, no reflux)
3. Move elements, for example, change top, left (jquery's animate method is to change top, left does not necessarily affect reflux ),
Or move the element to another parent element. (Re-painting + reflux)
4. operations on the style (the impact on different attribute operations is different)
5. user operations, such as changing the browser size and font size (reflux + re-painting)
Re-painting and Backflow