Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

浏览器什么时候发生回流和重绘? #12

Open
SampsonKY opened this issue Oct 4, 2020 · 0 comments
Open

浏览器什么时候发生回流和重绘? #12

SampsonKY opened this issue Oct 4, 2020 · 0 comments

Comments

@SampsonKY
Copy link
Owner

浏览器什么时候发生回流和重绘?

明确一点:回流必将引起重绘,重绘不一定会引起回流。

回流:

  1. 页面首次渲染
  2. 添加或删除可见的dom
  3. 元素尺寸或者位置发生变化
  4. 元素内容发生变化
  5. 浏览器窗口大小改变
  6. 激活css伪类
  7. 查询某些属性或者调用某些方法

重绘:页面中元素样式的改变不影响其在文档流中的位置时,浏览器会将新样式赋予给元素并重新绘制它。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant