render-tree 我在 html-parser 中实现了将 html 字符解析为 dom 树,代码采用 python 编写。 这里我将使用 TypeScript 实现 css 文件的解析,生成 css rules,并遍历 dom 树生成渲染树。