2015-01-10, CSS开发者大会
Copyright © 2014 W3C ® (MIT, ERCIM, Keio, Beihang)
吴小倩 <xiaoqian@w3.org>
W3C前端交互领域
2015-01-10, CSS开发者大会
1. 合理安排Selectors(selectors瘦身);
2. 高消耗属性?-> 绘制前需要浏览器进行大量计算:
box-shadows | border-radius |
transparency | transforms |
CSS filters(性能杀手) |
浏览器重新计算布局位置与大小。
常见的重排元素;
width | height | padding | margin |
display | border-width | border | top |
position | font-size | float | text-align |
overflow-y | font-weight | overflow | left |
font-family | line-height | vertical-align | right |
clear | white-space | bottom | min-height |
常见的重绘元素;
color | border-style | visibility | background |
text-decoration | background-image | background-position | background-repeat |
outline-color | outline | outline-style | border-radius |
outline-width | box-shadow | background-size |
发布Resource Priorities, Resource Hints, Navigation Timing等规范;
订阅public-web-perf@w3.org邮件组;
围观讨论;
Slides制作:shower
will-change图片来源:w3c meme
RAF图片来源:thetop10s.net
Ref:
1. Everything You Need to Know About the CSS will-change Property by Sara Soueidan
2. High Performance Animations by Paul Lewis and Paul Irish
3. We’re Gonna Need A Bigger API! by Jake Archibald
4. PERFORMANCE TRICKS FOR (MOBILE) WEB DEVELOPMENT
5. CSS performance revisited: selectors, bloat and expensive styles
Special thanks to PLH, for telling me all those stories about web-perf, and the W3C Beihang Team, for their help on Cookie.