惊喜:苹果新浏览器是 Konqueror 的姐妹

作者:Doc Searls

史蒂夫·乔布斯的 Macworld 主题演讲总是重大事件,其中会发布许多新内容,但很少有对 Linux OS 阵营的人们来说特别有趣的新闻。诚然,苹果公司多年来一直在谈论 UNIX 和开源,其基于 OS X 的笔记本电脑在 UNIX 环境中很受欢迎,包括许多 Linux 商店和家庭。但几乎没有人期望乔布斯会带来任何开源惊喜——尤其是基于 Linux 社区开发的代码的新应用程序。

Surprise: Apple's New Browser Is a Sister to Konqueror

但这正是他们用 Safari,苹果的新浏览器所做的。

曾有传言称,苹果将用自己的浏览器取代微软的 Internet Explorer 作为 OS X “dock” 中的默认浏览器。当与其他“媒体”一起排队等待被引导到主题演讲剧院的特殊区域时,我与一些老前辈交谈,他们翻着白眼回忆起苹果公司上一次浏览器的尝试,已故的 Cyberdog。默认的假设是,苹果公司将添加到 基于 Mozilla 的 Gecko 引擎的浏览器不断增长的列表中,也许会推出其自己品牌的 Chimera 版本。

但那并没有发生。相反,苹果公司做了一件更激进的事情:他们的新浏览器基于来自 KDEKHTML

以下是乔布斯在主题演讲中的说法

“我们是如何做到这一点的?我们的 Safari 基于一个开源的 HTML 渲染引擎。Safari 中大约一半的代码是这个开源渲染引擎。现在,我们在一年前就开始使用它。它需要大量改进。我们大幅提高了性能。有些东西的速度提升了一个数量级。而且,有些人对开源有意见。我们认为它很棒 [掌声],我们将把我们所有的改进都贡献给这个代码库——我们今天将在 Web 上托管它们。[掌声。]”

“我们决定开始使用的代码库是 KHTML。它在 Linux 世界非常流行。它是一个架构非常良好的 HTML 渲染引擎,现在已经得到了极大的改进……我们围绕它构建了一个令人难以置信的浏览器。我们对此非常满意。”

苹果公司的开发主管 Avie Tevanian 告诉我:

“我们考察了所有不同的潜在代码库来构建浏览器,包括完全从头开始构建一个。我们发现 KHTML 在速度、大小、质量、渲染最多网站的能力等方面为我们提供了最佳的权衡。它并不总是所有这些方面最好的,但在某些方面它表现出色,我们认为我们可以利用我们的资源并添加到其中,使其在所有这些方面都成为最好的。我们将继续贡献更改,我们希望其他人也会贡献更改回来。”

KDE 的新闻页面补充道:

KDE 连接:“[关于其网页渲染引擎,Safari 借鉴了 Konqueror 开源项目的软件。Konqueror 的大小不到另一个开源渲染器十分之一,有助于 Safari 保持精简和响应迅速。” Konqueror 的好消息是:苹果公司表示,它将成为“优秀的开源公民 [并] 与 Konqueror 开源社区分享其增强功能”,今天已将所有更改以及详细的更改日志发送给 KHTML 开发人员。祝贺 KHTML 开发人员因其杰出努力而获得认可……向合作致敬!”

这些开发人员通过 Safari 开发团队的 Don Melton 发给 Dirk Mueller 的这封电子邮件获得了消息。

From: Don Melton <gramps@apple.com>
Subject: Greetings from the Safari team at Apple ComputerDate: Tue, 7 Jan 2003 11:31:10 -0800Hi,
I'm the engineering manager of Safari, Apple Computer's new web browser
built upon KHTML and KJS.  I'm sending you this email to thank you for
making such a great open source project and introduce myself and my
development team.  I also wish to explain why and how we've used your
excellent technology.  It's important that you know we're committed to
open source and contributing our changes, now and in the future, back to
you, the original developers.  Hopefully this will begin a dialogue among
ourselves for the benefit of both of our projects.  I've "cc"-ed
my team on this email so you know their names and contact information.
Perhaps you already recognize some of those names.  Back in '98 I was
one of the people who took Mozilla open source.  David Hyatt is not only
the originator of the Chimera web browser project but also the inventor
of XBL.  Darin Adler is the former lead of the Nautilus file manager.
Darin, Maciej Stachowiak, John Sullivan, Ken Kocienda, and I are all
Eazel veterans.
The number one goal for developing Safari was to create the fastest
web browser on Mac OS X.  When we were evaluating technologies over a
year ago, KHTML and KJS stood out.  Not only were they the basis of an
excellent modern and standards compliant web browser, they were also less
than 140,000 lines of code.  The size of your code and ease of development
within that code made it a better choice for us than other open source
projects.  Your clean design was also a plus.  And the small size of
your code is a significant reason for our winning startup performance
as you can see reflected in the data at http://www.apple.com/safari/.
How did we do it?  As you know, KJS is very portable and independent. The
Sherlock team is already using it on Mac OS X in the framework my
team prepared called JavaScriptCore.  But because KHTML requires other
components from KDE and Qt, we wrote our own adapter library called KWQ
(and pronounced "quack") that replaces these other components.
KHTML and KWQ have been encapsulated in a framework called WebCore.
We've also made significant enhancements, bug fixes, and performance
improvements to KHTML and KJS.
Both WebCore and JavaScriptCore, which account for a little over half the
code in Safari, are being released as open source today.  They should
be available at http://developer.apple.com/darwin/projects/webcore/
very soon.  Also, we'll be sending you another email soon which details
our changes and additions to KHTML and KJS.  I hope the detailed list
in that email will help you understand what we've done a little better.
We'd also like to send this information to the appropriate KDE mailing
list. Please advise us on which one to use.
We look forward to your comments.  We'd also like to speak to you and
we'd be happy to set up a conference call at our expense for this purpose.
Please forward this email to any contributor whom I may have missed.
-- 
Don MeltonSafari Engineering ManagerApple ComputerP.S. -- I'm sending you this email while attending Macworld exposition
so it may take myself and my staff several hours before we can respond
to email.  My apologies in advance. 

以下是 Dirk 的回复:

From: Dirk Mueller <mueller@kde.org>Subject: Re: Greetings from the Safari team at Apple ComputerTo: Don Melton @apple.com[......]Date: Tue, 7 Jan 2003 21:18:19 +0100On Die, 07 Jan 2003, Don Melton wrote:
> I'm the engineering manager of Safari, Apple Computer's new web browser> built upon KHTML and KJS.  I'm sending you this email to thank you for> making such a great open source project and introduce myself and my> development team.  I also wish to explain why and how we've used your> excellent technology.  It's important that you know we're committed to> open source and contributing our changes, now and in the future, back> to you, the original developers.  Hopefully this will begin a dialogue> among ourselves for the benefit of both of our projects.I hope so too. I'm deeply impressed by your detailed changelog and by the
changes. A few of the changes have already happened in "our"
developing version and many of them were on our TODOs. For example just
about this weekend I was working on improving the kjs garbage collector
and now I read that you apparently already fixed the issues I had with
it. Seems to me like a huge Christmas gift. Thank you. Thanks a lot
Especially I'd like to hope that we could set up a mailing list where we
could exchange ideas, patches and bug reports. Also a common test suite
for regressions would be nice and probably help us a lot in developing
KHTML and KJS further. Ideally the plan should be, and I hope you agree,
to use a common code base for the backend.> Please forward this email to any contributor whom I may have missed.We've forwarded it to kfm-devel@kde.org.> P.S. -- I'm sending you this email while attending Macworld exposition> so it may take myself and my staff several hours before we can respond> to email.  My apologies in advance.Have some nice time there and greetings from Germany, I just watched
the Safari presentation :-)

当天晚些时候,Don Melton 回复了这封电子邮件

Hi,Here is the second email I promised which details our changes and
additions to KHTML and KJS which were done for Safari.
As it says on our open source web page at
http://developer.apple.com/darwin/projects/webcore/ the sources we will
post later today are based on KDE 3.0.2.  The best way to see every
change line by line is to diff against the originals.- --Don MeltonSafari Engineering ManagerApple Computer

在展会现场,我跟随一位 Safari 开发人员(我认为是 Melton)作为嘉宾参加了 David Lawrence 的 On-line Tonight 广播节目。Lawrence 告诉我,Safari 在第一天就被下载了超过 30 万次。这显然是一个热门产品,但不仅仅是因为它来自苹果而不是微软。它也是一个高性能的产品。

我在展会上与之交谈的每个人都对浏览器的速度发表了评论,与以臃肿著称的 Mac 版 Internet Explorer 相比,Safari 的速度似乎尤其快。

无线专家 Glenn Fleishman,他的 Practical Macintosh 专栏在 西雅图时报 上刊登,他告诉我他听说有报道称微软投入了无数的开发时间来优化 Windows 版 IE,但从未对 Mac 版做同样的事情。他说,使用 Safari,“苹果公司利用了投入到 KHTML 中的数千个开发人员工时,并投入了数千个自己的工时,所有这些都是为了解决渲染问题。” 明显的暗示是:浏览器领导地位已经不是传递给了苹果,而是传递给了开源开发社区,它一直属于那里。他补充说,“我不确定为什么 Mozilla 和 Gecko 没有做到这一点,”他补充说,“但这已经发生在 KHTML 身上。”

很难避免感觉到苹果选择 KHTML 是对 Mozilla 的轻视,尤其是考虑到 Safari 团队的许多关键成员都是 Mozilla 的资深人士。

虽然这是一个有趣的八卦话题,但还有更大的问题,例如苹果公司在与开源社区的关系中面临的挑战。James DavidsonLearning Cocoa with Objective CApache AntApache Tomcat 的原始作者)说,“在浏览器中使用 KHTML 提高了苹果公司对开源承诺的要求。现在是蜜月期,但从现在开始他们如何做将真的提高标准。这不像 Darwin,它有点安静且不高度曝光。这更加公开。我的意思是,数百万用户面对的这个东西,苹果公司称之为开源。用户会将此浏览器与开源联系起来,并期望错误报告通过开源流程进行。媒体也会提出更好的问题。”(Safari 的标题栏中有一个错误报告按钮。)

他还想知道社区参与将如何与苹果公司出了名的保密开发文化相协调。“他们喜欢惊喜,但那不是开源的工作方式。我确信这将是我们在这个项目上看到的最后一个惊喜。从现在开始,一切都必须公开。” 他补充说,“那里的试金石将是 KHTML 和 Moz 在标准支持方面有多接近。如果它们接近,那将把球踢给微软。然后我们将看到他们是否会再次使用 IE 耍花招。”

但这只是苹果公司的问题。对所有人来说更大的问题是标准。我在展会上与之交谈的极客们完全一致认为,Safari 的开源代码库创造了一个新的事实上的条件,有利于法律上的标准。一位苹果工程师解释说,“直到周二,事实上的标准是 IE。那是开发人员关心的,也是网站管理员关心的。现在不再是了。现在每个人都会用标准来衡量每个浏览器。如果你分叉标准,你就会分叉自己。” James Davidson 补充说,“Web 标准互操作性不再是游戏结束。你最好现在就遵守标准。”

Safari 远非一个完成的作品。尽管它的版本号为 1.0,但它仍处于 beta 测试阶段。它也受到了适当的抨击——不仅在各种列表上,而且在极客博客中也是如此。例如,Mark Pilgrim 发布了一篇充满错误列表的评论,苹果公司的 Dave Hyatt的博客上对此做出了坦率而有用的回应。

苹果公司的公关部门似乎没有任何干预。这不应该令人惊讶。苹果公司的工程师和公关人员已经告诉我两年多了,他们非常注意不干预公司的开源社区参与,而是宁愿“顺其自然”。

我们将拭目以待。

Doc SearlsLinux Journal 的资深编辑。

电子邮件:doc@ssc.com

加载 Disqus 评论