Introduction and summary of WebKit (1)

1. Introduction to WebKit

     Webkit is an open source browser engine (web browser engine), the original code comes from KDE's KHTML and KJS (both open source). Apple has done a lot of optimization and improvement work on the basis of Webkit. At this time, Apple Webkit has many differences from Webkit, and finally developed the famous Safari. It can be said that Safari is a very successful product, but Safari is not. open source.

WebKit-based browser products include: Apple's Safari and iPhone, Google's Chrome and Android, Nokia's S60, Maxthon3;

WebKit currently supports HTML4/5 , CSS1/2 , DOM1/2 , HTTP/FILE , GIF/JPEG/PNG , XML , SVG , RSS2.0 , etc.;

Similar browser engines include: Trident (IE kernel), Gechko (Netscape, Mozilla and Firefox kernel), Presto (Opera kernel, not free), Tasman (IE for MAC kernel), etc., and WebKit because of its powerful, Fast and free. Popular.

2. Libraries used: In addition to platform-related libraries, some of the main background libraries that WebKit needs to use are:
  

  • ICU: International Components for Unicode, a mature and widely used set of Unicode globalization support software for C/C++ and Java libraries ;

  • XSLT: eXtensible Stylesheet Language Transformation, a specification for XML document transformation defined by W3C;

  • Curl: A command-line data transfer tool utilizing URL syntax, based on libcurl .

  • Sqlite: SQLite is a SQL database engine that implements the SQL92 standard. It can combine database engines and interfaces in one library, and store all data in a single file;

  • Gperf: a perfect hash function generator;

  • Flex: Fast Lex, a fast lexical analysis generator;

  • Bison: a grammar analysis generator that can convert a piece of annotated context-free grammar into LALR or GLR grammar;

  • Enchant: A spell checking library that provides functions such as spell checking and error correction for words;

3. Code directory structure

  • WebKitTools
    some programs that test the functions implemented by WebKit;

  • WebKitLibraries
    The library used by WebKit and the definition of the system call interface;

  • WebKitExamplePlugins
    some plug-ins from Netscape, such as input method, animation and Cocoa environment, etc.;

  • WebKitSite: holds the www.webkit.org website

  • WebKit
    This directory is located at the top of WebKit and defines some application-related interfaces, so it is platform-dependent, and each subdirectory is a complete implementation of the corresponding platform:

  • cf : Core Foundation, the system-level C language API interface on MAC OS X;

  • win : Windows ;

  • mac : MAC OS X ;

  • qt: Q Toolkit, whose company has been acquired by Nokia;

  • gtk : Gimp Toolkit ;

  • scripts : Some scripts, currently there is only one script program about the WebKit version;

  • chromium: Google Chrome development platform;

  • wx: wxWindows, a portable C++ and Python GUI toolbox, by Julian Smart;

  • haiku: an open source OS, from BeOS, started in 2001, and released the first version in 2009;

  • efl: Enlightenment Foundation Libraries, Enlightenment platform; the core part of
    WebCore
    WebKit, which defines browsing-related data IO, page loading, script analysis, UI organization, event processing, network analysis, platform-related specific implementation, etc.

  • xml: provide xml-related content;
  • html : Provide html-related content; the Canvas directory under it defines 3D canvas and WebGL library-related content;
  • wml: Wireless Markup Language ;
  • css :提供 css 相关的内容;
  • dom :提供 dom 相关的内容;
  • editing :编辑相关的功能;
  • page :浏览相关内容,并非是我们看到的一个页面,在一次浏览会话中,它只有一个实例;
  • rendering :页面渲染相关的内容,在对页面脚本进行 DOM 树分析之后,需要对这些元素进行渲染和显示;
  • notification :内部模块间的事件通信;
  • history :页面浏览历史记录相关的内容;
  • svg :矢量图形功能,有选项, --svg ;
  • mathml : W3C 为网页中的数学表达式制定的规范;有编译选项, --mathml ;
  • loader : 加载资源及 Cache
  • workers :“ Web Workers WEB 前端网页上的脚本提供了一种能在后台进程中运行的方法。一旦它被创建, Web Workers 就可以通过 postMessage() 向任务池发送任务请求,执行完之后再通过 postMessage() 返回消息给创建者指定的事件处理 程序 ( 通过 onmessage 进行捕获 )
    Web Workers
    进程能够在不影响用户界面的情况下处理任务,并且,它还可以使用 XMLHttpRequest 来处理 I/O ,无论 responseXML channel 属性是否为 null 。”
  • storage : Web Storage 相关的内容,保存页面的数据,可以看成是 Cookie 的升级;
  • websockets :与网络连接相关的内容;
  • bridge: 主要包含 NPPlugin(Netscape Plugin) 方面的接口访问等内容;
  • binding : Dom 与 JavaScriptCore 绑定的功能;
  • accessibility :提供控件的可用性相关的内容, accessibility 常用来形容对一些特殊人群的功能支持,比如残障者、老人等;
  • icu :里面放了专门为 Mac OS X 10.4 编译的 icu 相关头文件 ;
  • platform :提供了平台相关的具体实现,如事件响应、本地化、网络连接等;
  • plugins :插件相关内容;
  • ForwardingHeaders :头文件;
  • inspector : Inspector 是 WebKit 提供的查看网页源代码, DOM 树,以及调试脚本的工具,本目录包含了实现此功能的内容;
  • Configurations : X Code 环境相关的配置文件;
  • English.lproj :本地化文件;
  • manual-tests :测试用的 html 文件;
  • Resources :资源,图标;
  • WebCore.gyp :工程文件。 GYP ( Generate Youre Project )是 google 自己开发了一个脚本工具,这个工具也 是采用 python 编写的。它采用了自定义的一套规则,用于生成各种工程文件;
  • WebCore.vcproj : VC 工程文件;
  • WebCore.xcodeproj : X Code 工程文件;
  • WTF : Apple 的 C++ 库,可以看作精简的 STL ; SunSpider
  • 一个 JavaScript 的检测程序,它不检测 DOM 或者浏览器其他的 API ,只用来检测 Javascript 。
  • JavaScriptGlue

  • JavaScriptCore :有关 JavaScript 的相关内容,包括了脚本解释器、分析器以及执行程序;

  • PlanetWebkit: 一个比较灵活的 RSS 阅读器; Webkit 网站上的 Planet :一站式的 Webkit 开发与动态信息;

. 体系结构

WebKit 主要包括三部分: WebKit , WebCore ,以及 JavaScriptCore ,加上所使用的库,依托的平台,其基本的体系结构 (Architecture) 如下所示:




注意有的模块相对于下面的模块有突出,这是因为此模块与下面几个模块直接相关,比如 WebCore 模块就与JavaScriptCore 、 Libraries 和 Platforms 模块直接相关。

 

Guess you like

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