同理,CSS规则树的生成也是类似。简述为:
Bytes → characters → tokens → nodes → CSSOM
譬如style.css内容如下:
body { font-size: 16px } p { font-weight: bold } span { color: red } p span { display: none } img { float: right }
那么最终的CSSOM树就是: