Http://blog.csdn.net/achellies/article/details/6106956
6. Compilation and debugging
Compile WebKit on ubuntu-10.04, version r60742, based on QT:
- Install sudo apt-Get install libxslt-dev gperf bison libsqlite3-dev flex libqt4-dev build-essential subversion libenchant-dev libxt-dev; if other libraries are not installed, follow the prompts, use apt-Get install. If you do not know the package name, use apt-Get
Search by name.
- Go to the WebKit directory and start Compilation: (this directory is used by default below)
Qtdir =/usr/share/qt4/./webkittools/scripts/build-WebKit -- QT -- debug
If you only use WebKit, regardless of the internal structure, you do not need the -- debug option;
If this is the first compilation, and the performance of your machine is average, it will take a little longer;
An error may occur in the middle. For example, if the file cannot be found, you need to check which package file you want to install.
- After the compilation is successful, a prompt is displayed.
========================================================== ============
WebKit is now built (1 H: 04 m: 28 S ).
To run qtlauncher with this newly-built code, use
"WebKit/webkittools/scripts/run-launcher" script.
========================================================== ============
Run the script run-launcher.
- Debug to view the WebKit workflow:
The actual running program of the script run-launcher is:./webkitbuild/debug/bin/qttestbrowser;
The program source code is:./webkittools/qttestbrowser /;
- Take www.baidu.com as an example to check the debugging process:
You need to set the breakpoint settings inside WebCore during the program running, because the symbol table of the so library is loaded at runtime (otherwise it is not called "Dynamic Link ), for example, use break main to stop in the main program, and then set WebCore: frameloader: load (...), you can set the following flag: when you enter a part of the breakpoint function name, press the tab key of 2 consecutively. A prompt is displayed;
After a breakpoint is stopped, you can use BT to view the call relationship before the function, such as the function in the call process.
- In addition, if you compile the WebKit of GTK, first ensure that the installation of GTK +-2.0 is complete, and then use a similar method:./webkittools/scripts/build-WebKit -- QT -- debug.
7. Main concept charts
There are thousands of classes in WebKit. Here we just outline some of the main classes and their relationships in WebKit, especially WebCore, and hope they can be used for reference.
8. References and resource links
The WebKit research is comprehensive and in-depth. The "WebKit Research Report" published by Hou Yi is divided into two parts: I and II, which can be easily searched online;
In addition, Jelly's blog also has a good discussion of WebKit, including the basic introduction, architecture and several important topics, the address is: http://www.jjos.org/tag/webkit;
There are also some authentic articles from the official WebKit website, www.webkit.org's Surfin blog: (in english, pay attention to the release time)
WebKit Web Cache I: http://webkit.org/blog/427/webkit-page-cache-i-the-basics/
Style scroll: http://webkit.org/blog/363/styling-scrollbars/
3D transform: http://webkit.org/blog/386/3d-transforms/
CSS unit: http://webkit.org/blog/57/css-units/
CSS animation I: http://webkit.org/blog/138/css-animation/
CSS animation II: http://webkit.org/blog/324/css-animation-2
CSS transform: http://webkit.org/blog/130/css-transforms/
CSS reflection: http://webkit.org/blog/182/css-reflections/
CSS mask: http://webkit.org/blog/181/css-masks/
CSS canvas: http://webkit.org/blog/176/css-canvas-drawing/
CSS gradient: http://webkit.org/blog/175/introducing-css-gradients/
CSS background crop: http://webkit.org/blog/164/background-clip-text/
Inspector Introduction: http://webkit.org/blog/41/introducing-the-web-inspector/
Inspector re-design: http://webkit.org/blog/197/web-inspector-redesign/
Test completely through acid3: http://webkit.org/blog/280/full-pass-of-acid-3/
Introduce squirrelfish, a new JavaScript engine:
Http://webkit.org/blog/189/announcing-squirrelfish/
Explore squirrelfish again: http://webkit.org/blog/214/introducing-squirrelfish-extreme/
Windows-based GDI text: http://webkit.org/blog/168/gdi-text-on-windows/
Refptr and passrefptr basics: http://webkit.org/coding/RefPtr.html
Web kit page loading process http://webkit.org/blog/1188/how-webkit-loads-a-web-page/
Client Data Storage: http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/
Rendering: http://webkit.org/blog/page/19/
Http://webkit.org/blog/96/background-music/ background music
Text stroke: http://webkit.org/blog/85/introducing-text-stroke/
Understanding HTML, XML, XHTML: http://webkit.org/blog/68/understanding-html-xml-and-xhtml/
Strange medium, about text: http://webkit.org/blog/67/strange-medium/
High dpi1: http://webkit.org/blog/55/high-dpi-web-sites/
High dpi2: http://webkit.org/blog/56/high-dpi-part-2/
WebCore directory structure: http://webkit.org/blog/42/webcore-directory-structure/
Button: http://webkit.org/blog/28/buttons/
Javascript compatibility with Dom: http://webkit.org/blog/27/javascript-and-dom-compatibility/
WebKit code style: http://webkit.org/blog/25/webkit-coding-style-guidelines/
Improved safari Memory leakage: http://webkit.org/blog/24/update-on-memory-leaks/
Safari Memory leakage check: http://webkit.org/blog/20/were-hunting-memory-leaks/
Hash Table 1: http://webkit.org/blog/6/hashtables-part-1/
Hash Table 2: http://webkit.org/blog/8/hashtables-part-2/
(The full text is complete. In this article, you are welcome to discuss it)