---
title: "转载:WebKit介绍及总结(三)"
author: "ap061ap"
date: "2012-07-01T10:07:31Z"
tags: []
categories: ["非技术"]
slug: "webkit"
draft: false
lastmod: "2012-07-01T10:07:31Z"
id: 1572879
url: "https://ap061ap.iteye.com/blog/1572879"
---

六 . 编译与调试 
　　在 ubuntu-10.04 上编译 Webkit ，所用的版本 r60742 ，基于 Qt ： 安装 sudo apt-get install libxslt-dev gperf bison libsqlite3-dev flex libqt4-dev build-essential subversion libenchant-dev libXt-dev ；如果有其他库没有安装，根据提示，用 apt-get install 安装，如果不知道包的名称，可以用 apt-get search NAME 搜索。 
　　进到 WebKit 目录下，开始编译： ( 以下默认为此目录 ) 
　　QTDIR=/usr/share/qt4/ ./WebKitTools/Scripts/build-webkit --qt --debug  
　　如果你只使用 WebKit 而不管内部结构，可以不用 --debug 选项；  
　　如果是第一次编译，而且你用的机器性能又一般，那么时间会长一点；  
　　中间可能出现错误，比如文件找不到，那么你要看看是哪个包的文件，要将这个包安装一下，诸如此类。 
　　编译成功之后，会有提示信息 
　　================================================== 
　　WebKit is now built (1h:04m:28s). 
　　To run QtLauncher with this newly-built code, use the 
　　"WebKit/WebKitTools/Scripts/run-launcher" script. 
　　================================================== 
　　然后可用脚本 run-launcher 运行。 
　　调试来查看 WebKit 的工作过程：  
　　脚本 run-launcher 实际的运行程序为： ./WebKitBuild/Debug/bin/QtTestBrowser ；  
　　程序源代码在： ./WebKitTools/QtTestBrowser/ ； 
　　以 www.baidu.com 为例，查看调试过程： 
　　对 WebCore 内部的断点设置，需要在程序运行过程中设定，因为 so 库的符号表是运行时加载的（不然就不叫"动态链接"了），比如先用 break main 在 main 程序停住，然后设置 WebCore::FrameLoader::load(...) ，可以设置的标志是：当你输入部分断点函数名，连续按 2 下 Tab 键，会有提示；  
　　在某个断点停住之后，可以用 bt 查看此函数之前的调用关系，比如调用过程中的函数。 
　　另外，如果编译 GTK 版本的 WebKit, 首先确保 Gtk+-2.0 安装完毕，然后用类似的方法： ./WebKitTools/Scripts/build-webkit --qt --debug 即可。 
　　七 . 主要概念类图 
　　WebKit 中的类有几千个之多，这里只是将 WebKit 特别是 WebCore 中主要的一些类及其关系勾画出来，希望能给大家以借鉴。 
　　
　　八 . 参考文献及资源链接 对 webKit 探讨比较全面和深入的，首推侯炯的《 WebKit 研究报告》，分 I 、 II 两部分，在网上可以轻易搜到； 
　　另外， Jelly's Blog 中也对 WebKit 有比较好的探讨，包括基础介绍、架构以及几个重要的专题，地址是： http://www.jjos.org/tag/webkit ； 
　　还有一些正宗的文章，来自 WebKit 官方网站， www.webkit.org 的 Surfin 博客：（英文，另外注意发布时间） WebKit 页面缓存 I: http://webkit.org/blog/427/webkit-page-cache-i-the -basics/ 样式滚动条: http://webkit.org/blog/363/styling-scrollbars/ 3D 变换 : http://webkit.org/blog/386/3d-transforms/ CSS 单元：http://webkit.org/blog/57/css-units/ CSS 动画I ：http://webkit.org/blog/138/css-animation/ CSS 动画II:http://webkit.org/blog/324/css-animation-2 CSS 变换：http://webkit.org/blog/130/css-transforms/ CSS 反射：http://webkit.org/blog/182/css-reflections/ CSS Mask ： http://webkit.org/blog/181/css-masks/ CSS 画布： http://webkit.org/blog/176/css-canvas-drawing/ CSS 梯度： http://webkit.org/blog/175/introducing-css-gradien ts/ CSS 背景裁剪： http://webkit.org/blog/164/background-clip-text/ Inspector 介绍： http://webkit.org/blog/41/introducing-the-web-insp ector/ Inspector 重新设计： http://webkit.org/blog/197/web-inspector-redesign/ 完全通过 Acid3 测试： http://webkit.org/blog/280/full-pass-of-acid-3/ 介绍新的 JavaScript 引擎-- SquirrelFish ：  
　　http://webkit.org/blog/189/announcing-squirrelfish / 再次探讨 SquirrelFish ： http://webkit.org/blog/214/introducing-squirrelfis h-extreme/ Windows 系统的 GDI 文字： http://webkit.org/blog/168/gdi-text-on-windows/ RefPtr 与 PassRefPtr 基础： http://webkit.org/coding/RefPtr.html webkit 页面加载过程 http://webkit.org/blog/1188/how-webkit-loads-a-web -page/ 客户端数据存储： http://webkit.org/blog/126/webkit-does-html5-clien t-side-database-storage/ Rendering ： http://webkit.org/blog/page/19/ 背景音乐： http://webkit.org/blog/96/background-music/ Text Stroke ： http://webkit.org/blog/85/introducing-text-stroke/ 理解 html,xml,xhtml:http://webkit.org/blog/68/understan ding-html-xml-and-xhtml/ Strange Medium ，关于 Text ： http://webkit.org/blog/67/strange-medium/ 高 DPI1 ： http://webkit.org/blog/55/high-dpi-web-sites/ 高 DPI2 ： http://webkit.org/blog/56/high-dpi-part-2/ Webcore 目录结构： http://webkit.org/blog/42/webcore-directory-struct ure/ 按钮： http://webkit.org/blog/28/buttons/ Javascript 与 DOM 的兼容： http://webkit.org/blog/27/javascript-and-dom-compa tibility/ Webkit 代码风格： http://webkit.org/blog/25/webkit-coding-style-guid elines/ Safari 内存泄漏的改进： http://webkit.org/blog/24/update-on-memory-leaks/ Safari 内存泄漏的检查： http://webkit.org/blog/20/were-hunting-memory-leak s/ 哈希表 1 ： http://webkit.org/blog/6/hashtables-part-1/ 哈希表 2: http://webkit.org/blog/8/hashtables-part-2/ （全文完，文中对错，欢迎讨论）