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

页面渲染优化 #13

Open
mishe opened this issue Nov 30, 2015 · 0 comments
Open

页面渲染优化 #13

mishe opened this issue Nov 30, 2015 · 0 comments

Comments

@mishe
Copy link
Owner

mishe commented Nov 30, 2015

告知浏览器开启渲染优化

拥有3d transform属性
使用animation, transition实现opacity, transform的动画
使用CSS filters的元素
使用 will-change

优化页面渲染的措施

gif图即使被其他Layer盖住不可见,也可能导致paint,不需要时应将gif图的display属性设为none。
为引起大范围Paint的元素生成独立的Layer以减小Paint的范围
可以采用fastDom.JS 优化
动画开始滚动后通过event-pointer: none禁止鼠标行为,减少不必要的repaint。
避免在动画过程中触发垃圾回收

Layout小结

不但改变CSS可能导致Layout,读取位置大小相关得属性也会导致Layout
分离读写,减少Layout

Paint小结

简化绘制的复杂度
避免不必要的绘制
减少绘制区域

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

No branches or pull requests

1 participant