嵌入应用程序中的最佳 HTML 渲染引擎是什么?

发布于 2024-07-06 17:27:07 字数 1450 浏览 6 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

以往的大感动 2024-07-13 17:27:07

了解一些历史可能有助于您的决定。 当 Apple 考虑使用哪种引擎来制作 Safari 时,他们考虑了 Gecko,但决定使用 KHTML,将其分叉并命名为 WebKit。 他们这样做的原因是 Gecko 拥有大量 Netscape 遗留下来的遗留物,而且要复杂得多。

KHTML/WebKit 较新,因此遗留的内容较少。 它也更干净、更快、记录更完善。

Firefox 3 的目标之一是清理代码库并简化它。 据我所知,他们确实这样做了,但我不知道它与当前的 WebKit 迭代相比如何。 当谷歌开发Chrome时,这显然还不够,他们还持有火狐的大量股份。

请参阅此处了解更多详细信息。

A little history might help in your decision. When Apple was considering which engine to use in making Safari they looked at Gecko, but decided to go with KHTML, fork it and called it WebKit. Their reasons for doing this was that Gecko had tons of legacy cruft still leftover from Netscape and was far more complicated.

KHTML/WebKit was newer, and thus had less legacy. It was also cleaner, quicker, and better documented.

One of the goals of Firefox 3 was to clean up the codebase and simplify it. From what I've heard they did do this, but I don't know how it compares with current iterations of WebKit. It apparently wasn't enough for Google when they made Chrome, and they have a significant stake in Firefox.

See here for more details.

笛声青案梦长安 2024-07-13 17:27:07

我有偏见,但如果您不介意使用(LGPL-ed)Qt,那么使用 QtWebKit 怎么样? ? 它相当容易嵌入,当然是跨平台的,有一个很好的网络浏览器演示,还有其他相关示例

I am biased, but if you do not mind using (LGPL-ed) Qt, what about using QtWebKit? It is fairly easy to embed, cross-platform of course, has a nice web browser demonstration, and also other related examples.

叹沉浮 2024-07-13 17:27:07

这取决于您的需求。 如果您只想显示普通的旧式 HTML,即使是 Webkit 也可能有点过分了。 在我的一些应用程序中,我使用 wxHTML。 它是 wxWidgets 库中的一个组件(不过不确定是否可以在没有 wx 的情况下使用它)。 它是轻量级的,只支持基本的 HTML 内容(一些 CSS 支持可能会在下一个版本中提供),并且有一个非常好的 wxHtmlEasyPrinting 控件,它提供了漂亮的打印预览并且打印效果也很好。 至于跨平台,wxWidgets可以在Windows、Linux、Mac和其他一些系统上运行,因此肯定可以满足您的要求。

我不建议走Gecko路。 集成它是可能的,但它比 KHTML/Webkit 更难做到 - 仅仅是因为 Gecko 在构建时没有考虑到嵌入。

It depends on your needs. Even Webkit can be overkill if you just want to display plain-old HTML. In some of my applications I use wxHTML instead. It's a component from wxWidgets library (not sure if you can use it without wx though). It's lightweight, supports just basic HTML stuff (some CSS support might be available in the next version), and has a really nice wxHtmlEasyPrinting control which gives nice print preview and also prints very well. As for cross-platform, wxWidgets works on Windows, Linux, Mac, and some other systems, so that would surely fit your requirements.

I don't recommend going down the Gecko road. It is possible to integrate it, but it's much harder to do than KHTML/Webkit - simply because Gecko was not built with embedding in mind.

请止步禁区 2024-07-13 17:27:07

我想我会建议 Safari/Chrome 的 WebKit 引擎,它源自 KHTML(Konqueror 渲染引擎)。

I think I would suggest Safari/Chrome's WebKit engine which was derived from KHTML, the Konqueror rendering engine.

飞烟轻若梦 2024-07-13 17:27:07

尝试选择 Webkit,因为许多不同的浏览器(Konqueror、Safari 和 Google Chrome)都使用它。 这使得 Webkit 更加通用,更能适应其他需求。

Gecko 的开发与 Firefox 密切相关。 对 Gecko 所做的许多修改都是因为 Firefox 的规定而完成的。 例如,出于安全目的,Firefox 3 决定阻止所有自签名证书。 该实现已在 Gecko 的引擎中完成,这意味着任何决定嵌入 Gecko 的应用程序都会添加此安全约束。

如果您可以继续使用 Webkit,因为它主要是 HTML 页面的渲染引擎。 它的开发目的是为了在不同的网络浏览器之间使用。 虽然 Gecko 主要是单个浏览器的渲染引擎,但它恰好提供了用于嵌入的 API。

Try to opt for Webkit as it is used by many different browsers (Konqueror, Safari and Google chrome). This makes Webkit more versatile and more adaptable to other needs.

The development of Gecko is very tied with Firefox. A lot of modifications made to Gecko are done because Firefox dictates them. For instance, Firefox 3 decided that it was going to block all self signed certificates for security purposes. The implementation has been done into Gecko's engine which means that any application that decides to embed Gecko has this security constraint added to them.

If you can stay with Webkit as it mainly a rendering engine for HTML pages. That's been developed with the intention to be used among different web browser. While Gecko is primarily the rendering engine of a single browser which just happens to offer an API for embedding.

昵称有卵用 2024-07-13 17:27:07

我的理解是 Webkit 非常好 & 比壁虎小。 不过,Gecko 最近应该进行了改造,使其具有相当的可比性。

My understanding is Webkit is pretty good & smaller than Gecko. Gecko is supposed to have had a revamp recently which makes it fairly comparable, though.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文