Introduction and summary of WebKit (3)

 

6. Compile and debug

Compile Webkit on ubuntu-10.04, the version r60742 used, based on Qt:

  1. 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, install them with apt-get install according to the prompt, if you don’t know the package can be searched with apt-get search NAME.
  2. Go to the WebKit directory and start compiling: (The following defaults to this directory)
    QTDIR=/usr/share/qt4/ ./WebKitTools/Scripts/build-webkit --qt --debug
    If you only use WebKit regardless of the internal structure, You can not use the --debug option;
    if it is the first time to compile, and the performance of the machine you are using is average, then the time will be longer; there
    may be errors in the middle, such as the file cannot be found, then you have to check which package file it is , to install this package, and so on.
  3. After the compilation is successful, there will be a prompt message
          ============================================= ========
                        WebKit is now built (1h:04m:28s).
                         To run QtLauncher with this newly-built code, use the
                         "WebKit/WebKitTools/Scripts/run-launcher" script.
         ===== ================================================
    Then the script can be run- launcher runs.
  4. Debug to view the working process of WebKit:
    the actual running program of the script run-launcher is: ./WebKitBuild/Debug/bin/QtTestBrowser;
    the program source code is in: ./WebKitTools/QtTestBrowser/;
  5. Take www.baidu.com as an example to view the debugging process:
    the breakpoint setting inside WebCore needs to be set during the running of the program, 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 first, and then set WebCore::FrameLoader::load(...), the flag that can be set is: when you enter part of the breakpoint function name, press the Tab key twice , there will be a prompt;
    after stopping at a certain breakpoint, you can use bt to view the previous calling relationship of this function, such as the function in the calling process.
  6. In addition, if compiling the GTK version of WebKit, first ensure that Gtk+-2.0 is installed, and then use a similar method: ./WebKitTools/Scripts/build-webkit --qt --debug.

Seven . Main concept class diagram

There are thousands of classes in WebKit. Here we just outline some of the main classes and their relationships in WebKit, especially WebCore, hoping to give you a reference.

 

 

8. References and resource links

For a more comprehensive and in-depth discussion of webKit, Hou Jiong's "WebKit Research Report", which is divided into two parts I and II, can be easily found on the Internet;

In addition, Jelly's Blog also has a good discussion on WebKit, including 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, the Surfin blog at www.webkit.org: (in English, and pay attention to the release time)

  • WebKit Page Cache I: http://webkit.org/blog/427/webkit-page-cache-i-the-basics/

  • Styling Scrollbars: http://webkit.org/blog/363/styling-scrollbars/

  • 3D Transforms: http://webkit.org/blog/386/3d-transforms/

  • CSS Units: http://webkit.org/blog/57/css-units/

  • CSS 动画I :http://webkit.org/blog/138/css-animation/

  • CSS Animation II: http://webkit.org/blog/324/css-animation-2

  • CSS Transforms: http://webkit.org/blog/130/css-transforms/

  • CSS reflections: 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 Gradients: http://webkit.org/blog/175/introducing-css-gradients/

  • CSS background clipping: http://webkit.org/blog/164/background-clip-text/

  • Introducing the Inspector: http://webkit.org/blog/41/introducing-the-web-inspector/

  • Inspector Redesign: http://webkit.org/blog/197/web-inspector-redesign/

  • Fully pass the Acid3 test: http://webkit.org/blog/280/full-pass-of-acid-3/

  • Introducing the new JavaScript engine - SquirrelFish:
    http://webkit.org/blog/189/announcing-squirrelfish/

  • Introducing SquirrelFish again: http://webkit.org/blog/214/introducing-squirrelfish-extreme/

  • GDI Text on Windows: http://webkit.org/blog/168/gdi-text-on-windows/

  • RefPtr and PassRefPtr basics: http://webkit.org/coding/RefPtr.html

  • webkit page loading process http://webkit.org/blog/1188/how-webkit-loads-a-web-page/

  • Client side data storage: http://webkit.org/blog/126/webkit-does-html5-client-side-database-storage/

  • Rendering : http://webkit.org/blog/page/19/

  • Background music: 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/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/

  • Buttons: http://webkit.org/blog/28/buttons/

  • Javascript and DOM compatibility: http://webkit.org/blog/27/javascript-and-dom-compatibility/

  • Webkit coding style: http://webkit.org/blog/25/webkit-coding-style-guidelines/

  • Improvements to Safari memory leaks: http://webkit.org/blog/24/update-on-memory-leaks/

  • Safari memory leak check: http://webkit.org/blog/20/were-hunting-memory-leaks/

  • Hashtables 1: http://webkit.org/blog/6/hashtables-part-1/

  • Hashtables 2: http://webkit.org/blog/8/hashtables-part-2/

(End of the full text, right or wrong in the text, welcome to discuss)

For more technical articles, please pay attention to the official account: zhuji101

Guess you like

Origin blog.csdn.net/spacetiller/article/details/5784587