浏览器如何解析/渲染CSS? [英] How do browsers parse/render CSS?

查看:118
本文介绍了浏览器如何解析/渲染CSS?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

他们使用哪种图形框架/技术来理解和绘制CSS指令?我问,是因为我会对编写使用CSS作为布局机制的软件感兴趣。由于CSS是一个相当大的规范,编写我自己的
CSS渲染器难道不会很难吗? (这就是为什么浏览器差异如此之大吗?)

What kind of graphical frameworks/technologies do they use to understand and draw CSS instructions? I'm asking, because I would be interested in writing software that uses CSS as a layouting mechanism. Since CSS is a pretty big specification, wouldn't it be incredibly hard to write my own css renderer? (that's why there are so many browser discrepencies right?)

我找到了此链接:浏览器如何阅读和解释CSS?

但是它只是说浏览器有自己的实施。因此,他们只有一群人来负责CSS规范的更新,并试图尽快实施它们?所以我不能自己动手做吗?

But it only says that browsers have their own implementation. So they just have a whole team of people looking after updates on the CSS specifications and trying to implement them as fast as possible? So i can't do it on my own time?

推荐答案

重新实施所有操作会使自己完全发疯!

To re-implement all that yourself would be totally and utterly insane!

只需使用基于HTML / CSS的东西,例如webkit(也包装在Qt框架内)。不再做所有的事情,您只会犯同样的错误...

Simply use an HTML/CSS based thingy like webkit (also wrapped inside the Qt framework). Don't do it all again, you'll just make all the same mistakes...

如果您想分析webkit如何处理CSS,则源代码是开放的

If you want to analyse how webkit handles CSS, the source code is open.

http://www.webkit.org/

http:// trac。 webkit.org/browser/trunk/Source

这篇关于浏览器如何解析/渲染CSS?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆