1 what is webkit?
WebKit 是一個開源瀏覽器網頁排版引擎,與之相應的引擎有Gecko(Mozilla,Firefox 等使用的排版引擎)和Trident(也稱為MSHTML,IE 使用的排版引擎)。同時WebKit 也是蘋果Mac OS X 系統引擎框架版本的名稱,主要用于Safari,Dashboard,Mail 和其他一些Mac OS X 程序。WebKit 所包含的 WebCore 排版引擎和 JSCore 引擎來自于 KDE 的 KHTML 和 KJS,當年蘋果比較了 Gecko 和 KHTML 后,仍然選擇了后者,就因為它擁有清晰的源碼結構、極快的渲染速度。
目前使用WebKit 引擎的瀏覽器主要有:Safari(apple出品),Midori,chrome(google出品)等。
PS:
網頁瀏覽器 列表 比較 使用分佈 時間線 分類 Trident Gecko KHTML WebKit Presto Java Tasman 手持設備 嵌入式系統 (,,,,) 排版引擎 排版引擎 排版引擎或 框架 排版引擎 軟體平臺 排版引擎 文字界面 或 其它 關聯項目Internet Explorer · 傲游 · 世界之窗瀏覽器 · Avant · 騰訊TT · Netscape 8 · NetCaptor · Sleipnir · GOSURF · GreenBrowser · KKman |
Fennec · Firefox · 網景 ( 6 至 9 ) · SeaMonkey · Camino · Flock · Galeon · K-Meleon · Minimo · Mozilla · Sleipnir · Songbird · XeroBank |
Chromium · Epiphany · Google Chrome · iCab · Konqueror · Midori · OmniWeb · Safari · Shiira |
Opera · 任天堂DS瀏覽器 |
HotJava · Opera Mini · UCWEB |
Internet Explorer for Mac · MSN for Mac OS X |
Lynx · Links · w3m |
Internet Explorer Mobile · Minimo · Opera Mobile · PSP瀏覽器 |
Amaya · Dillo · Mosaic |
HTML · HTML排版引擎 · 分頁瀏覽器 · 網頁伺服器 · 瀏覽器大戰 |
2 WebKit Open Source Project 內核引擎的前世今生
WebKit 的前身是 KDE 小組的 KHTML 。Apple將 KHTML 發揚光大,推出了裝備 KHTML 改進型的 WebKit 引擎的瀏覽器 Safari ,獲得了非常好的反響。
WebKit 引擎比 Gecko 引擎更受 程序員 歡迎的原因,除了其引擎的高效穩定,兼容性好外,其源碼結構清晰,易于維護,是一個重要的原因。而 Gecko 的可維護性就差多了。我在 2008年6月時候,曾編譯 Gecko 引擎,準備做一個基于 Gecko 的 Embed 應用 程序 ,但文檔缺乏、結構欠清晰,折騰了一星期之后,最終不得不承認自己水平有限,放棄了事。
現在瀏覽器的內核引擎,基本上是三分天下:
WebKit 內核在手機上的應用十分廣泛,例如 Google 的手機 Gphone、 Apple 的 iPhone, Nokia’s Series 60 browser 等所使用的 Browser 內核引擎,都是基于 WebKit。
Webkit內核在手機上的應用十分廣泛,這得益于webkit引擎的高效穩定,兼容性好。在桌面平臺上它獲得了acid3的100/100的得分。webkit最大的特點是速度快、JS腳本處理速度是IE的6倍,同時在安全性穩定性都很出色,對web標準兼容好等特點,webkit 是一項開源工程,以每夜構建方式更新。
PS:
目前比較有名氣的瀏覽器有:
- Mozilla Firefox,美國的,是開源項目。
- Microsoft Internet Explorer,美國的。
- Opera,挪威的。
- Konqueror,屬KDE開發組,美國的,是開源項目。
- WebKit,美國的,是開源項目。
Webkit學習
( 參考博客:http://blog.csdn.net/sgnaw/archive/2008/05/25/2479573.aspx )
Although WebKit is a complete web rendering and layout engine, it requires platform-specificfunctionality for infrastructure and display. For this reason, the intergation of WebKit in Qt is implemented using Qt primitives. The WebKit backend is implemented using the QtAPI toprovidedrawing and network communication. In addition, parts of the WebKit API are wrapped in Qt-style classes to ensure a uniform and intuitive API across all modules conforming to Trolltech guidelines。
3 webkit QT Port:
WebKit 瀏覽器源程序下載:
- http://webkit.org
- http://trolltech.com/downloads
Link : http://live.gnome.org/WebKitGtk
5webkit EFL Port
webkit ported to the Enlightenment Foundation Libraries
( http://code.staikos.net/cgi-bin/gitweb.cgi?p=webkit;a=shortlog;h=kenneth/efl-port )
6 webkit on maemo
maemo-developers:
http://www.gossamer-threads.com/lists/maemo/developers/25399
browser for maemo
http://browser.garage.maemo.org/docs/browser_paper.html
owb- based SDL and webkit
http://www.sand-labs.org/owb/wiki/OwbN800
Mazilla browser on maemo
http://browser.garage.maemo.org/
WebKit VS Gecko
Webkit 的優勢
Webkit 是一個開源的HTML 渲染引擎,由蘋果公司基于 KDE 的 KHTML 項目開發而成。我們從 Chrome 的評測中已經看Webkit 是一個非常輕量的渲染引擎,因其緊湊干凈的代碼基礎,出色的標準支持,以及很小的內存占用而備受贊譽。這些品質使得 Webkit 成為眾多瀏覽器的熱選內核。
Webkit 主要用于蘋果的 Safari 瀏覽器與 iPhone,但一些重要的廠商如 Adobe,Nokia, Trolltech 也使用這個核心。Webkit 的用戶中還包括一些不太知名的瀏覽器,包括 iCab, Omniweb, Shiira, 以及 Epiphany。在一些二線操作系統,如 Haiku, Syllable, 甚至 Amiga,Webkit 也大行其道。越來越多的開發者,使用 Webkit 開發富 Internte 應用(rich Internet applications)。Google 在對眾多內核進行評估之后,為 Android 移動瀏覽器,以及 Chrome 桌面瀏覽器選擇了 WebKit。
開發者對 Webkit 公認的評價是:這是一個非常出色的渲染引擎,可以用于眾多場合,它的吸引力讓很多開發者開始懷疑 Mozilla 的 Gecko 內核是否還有市場。
Gecko
Gecko 源自 Netscape,并早于 KHTML,Gecko 因龐大與復雜的代碼基礎而頻遭詬病。Gecko 非常強大,但代價高昂,復雜,高內存占用。因此,在很多場合 Gecko 的眾多功能反而成了負擔。
Gecko 內核過于復雜的原因是 Gecko 意圖提供除了 HTML 渲染之外的更多功能。Mozilla 早期的野心很大,Mozilla 最早的應用套件包括瀏覽器,郵件和新聞組程序,Web 設計工具,IRC 聊天工具。除了渲染 HTML,Gecko 還要提供一種應用廣泛的,基于 XML 的用戶界面生成引擎,XUL。XUL 被用在所有這些程序中。XUL 現在仍用在 Firefox 中,用來生成用戶界面,因此造就了 Firefox 最有價值的重多擴展應用。
Gecko 過于復雜的另外一個原因是 XPCOM,一個強大的組件系統。雖然 XPCOM 為 Gecko 帶來很多激動人心的功能,讓這個渲染引擎實現組件化,然而,這個功能被一些開發者濫用,當 Ars Technica2004年采訪 Mozilla 開發者 Scott Collins的時候,Scott Collins 說,對 XPCOM 的濫用是 Mozilla 犯的幾個主要錯誤之一。
鑒于 XUL 和 XPCOM 所帶來的復雜性,蘋果自然要考慮為 Safari 選擇一種更輕量的內核。蘋果要設計一款可以和 Mac 操作系統緊密結合的瀏覽器,他們還預見到,這個引擎應該支持移動設備,他們因此認識到 KHTML 比 Gecko 更合適。
2003年,當蘋果決定在 Safari 中使用 KHTML 的時候,Mozilla 的 Mike Shaver 曾在博客中承認 Gecko 的缺點。他同時預言,蘋果會成為他們推廣 Web 標準的聯盟。他寫道,
“小而精練曾是我們的苦苦追尋的目標,Gecko 的龐大與臃腫在各種評測中拉了我們的分數,如果我不得不寫一個新瀏覽器,我會考慮 Mozilla 之外的選擇。我希望 Mozilla 向 Safari/KHTML 學習,因為它們用 1/10 的代碼實現了非常棒的功能。”
Gecko 洗心革面帶來 Firefox 3 的火爆
2003年以來,發生了很多變化。Gecko 代碼基礎已經發展了很久,Gecko 依然復雜,然而它的很多歷史遺留的缺陷正被一一攻破,Gecko 為 Firefox 3 帶來眾多革新,為整個 Web 瀏覽體驗帶來非常顯著的改善。
Gecko 1.9 使用跨平臺的 Cairo 渲染框架,對 SVG 的巨大改進簡化了代碼并引入一些非常 Cool 的功能,如全頁縮放,同時,重構的 reflow 算法,讓 Gecko 通過 Acid 2 測試成為可能。Mozilla 還非常顯著地降低了對內存的占用,甚至超越了 Safari 和 Opera。
對 XPCOM 的使用被大大減少,XPCOM 對資源的占用通過一個新的循環回收器得到減低。這個工作仍在繼續,Mozilla 將在 Firefox 4 中進一步減低 XPCOM 的負擔。Gecko 的其它缺陷也在新的開發中被一一正視,比如,Firefox 3.1 的 Alpha 版中就已經加入對 CSS 3 的支持,另外一些性能的改進會讓 Gecko 更具競爭性。Mozilla 的 TraceMonkey 引擎將可能包含在 Firefox 3.1 中,這將顯著地提高 JavaScript 性能。
從技術的角度,Gecko 現在非常穩固,絲毫不比 Webkit 差。一些證據顯示,Gecko 正在進軍移動領域,這在不久前還是不可能的事。Mozilla 擁有資源,開發經驗以及社區支持,這將引導 Gecko 進入任何 Webkit 所能進入的地盤。
PS: Chrome
一:國外資源
SVN:
http://src.chromium.org/svn/trunk
打包:
http://build.chromium.org/buildbot/archives/chromium.tgz
homePage:
http://code.google.com/chromium/developerPage :
國內免proxy:
http://sites.google.com/a/chromium.org/dev/Home
1: http://www.catonmat.net/blog/code-reuse-in-google-chrome-browser/
網上一個blog,列出了Chrome用到的開源庫,鏈接在這:
2、http://www.cnblogs.com/hesicong/archive/2007/06/29/800017.html
集成VS 2005 sp1
3:http://www.paperfrag.com chrome中使用ActiveX的方法。
4:http://blog.chromium.org/ chrome官方BLOG
Google has setup the following discussion groups
chromium-announce <http://groups.google.com/group/chromium-announce > Announcements are sent to this list when a new build is available on the developer channel, and at other important events relevant to a majority of users. This is a low-volume, moderated list.
chromium-discuss http://groups.google.com/group/chromium-discuss
General Chromium discussion, ideas and suggestions should go here.
This is a high-volume mailing list, and in general is the right list to post to as a default if you are unsure of exactly where you should post.
Topical posts include items such as ideas for new features or the improvement of existing features, questions or comments around the high level design of Chromium, and other high-level topics that are not necessarily focused on the actualengineering or implementation of code.
The engineering (developer) team uses this to discuss technical issues and for announcements. This is a moderate volume, high technical content mailing list.
Topical posts include items such as plans to reduce memory consumption, discussion around how certain code areas are implemented and how to extend or improve such code, announcements of new tests being added to the buildbots, and so forth. chromium-reviews
http://groups.google.com/group/chromium-reviews
The engineering (developer) team uses this to conduct code reviews of changes to the Chromium source. This is a high volume, high technical content mailing list. Topical posts are strictly limited to code reviews. All email threads on this list originate from code reviews. Please do not start new threads on this list.
chromium-checkins
http://groups.google.com/group/chromium-checkins
This is a read-only list that can be used to monitor individual checkins tothe Chromium source. This is a high volume, high technical content mailing list. All emails to this list are automatically generated when code is checked in. Please donot send emails to this list. chromium-bugs http://groups.google.com/group/chromium-bugs
This is a read-only list that contains all of the bug database email traffic. All email threads originate from bugs opened in the bug database.Please do not create new threads on this list
chromiumdev:
http://sites.google.com/site/chromiumdev/
6:chromium-dev
http://groups.google.com/group/chromium-dev
7: chromespot
維基百科:
http://zh.wikipedia.org/w/index.php?title=Chrome&variant=zh-cn
8:官方開發網站
http://sites.google.com/a/chromium.org/dev/
9:chrome發布網站 http://googlechromereleases.blogspot.com/
10:WEBKIT BLOG
.二:中文部分
1: http://www.downdig.com/chrome
chrome比較完整的中文信息
2:CSDN資源Android研究
源碼解析系列:
http://blog.csdn.net/bzero1982
Chrome源碼剖析:
http://www.cnblogs.com/duguguiyu/
谷歌瀏覽器的源碼分析:
WEBKIT研究:
chrome源碼優化:
http://blog.csdn.net/kokocsyuanwen : http://hi.baidu.com/elseif/blog/item/317eda5000d8a2658535240c.html
<script type="text/javascript"></script>
更多文章、技術交流、商務合作、聯系博主
微信掃碼或搜索:z360901061

微信掃一掃加我為好友
QQ號聯系: 360901061
您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點擊下面給點支持吧,站長非常感激您!手機微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點擊微信右上角掃一掃功能,選擇支付二維碼完成支付。
【本文對您有幫助就好】元
