1 / 27

Introduction to WebKit

Introduction to WebKit. Girish Ramakrishnan. History. 1999. 2001-3. 2005. What is WebKit. WebKit is a rendering engine for web content WebKit is not a browser, a science project, or the solution to every problem. HTML. Rendering of a web page. WebKit. JavaScript. CSS.

ariane
Download Presentation

Introduction to WebKit

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Introduction to WebKit Girish Ramakrishnan

  2. History 1999 2001-3 2005

  3. What is WebKit WebKit is a rendering engine for web content WebKit is not a browser, a science project, or the solution to every problem HTML Rendering of a web page WebKit JavaScript CSS Image stolen from Adam Barth’s Presentation

  4. WebKit ports WebKit is designed to be highly portable

  5. Components WebKit and WebKit2 (Embedding API) Bindings (JavaScript API, Objective-C API) JavaScriptCore (JavaScript Virtual Machine) WebCore (HTML, CSS, DOM, etc, etc) Platform (Network, Storage, Graphics) WTF (Data structures, Threading primitives) Image stolen from Adam Barth’s Presentation

  6. WTF!? • The STL of WebKit project • Data structures • String • URL parser • Compiled as static lib • Minimal porting required (ifdef’s) • Source/WTF

  7. JavaScriptCore (AKA SFX and Nitro) • Primarily developed by Apple • Byte Level Interpreter (Llint) • Optional DFG JIT • Non-trivial to use a stand alone • Compiled as static lib • Source/JavaScriptCore

  8. WebCore • HTML, CSS, XML, SVG ….

  9. WebCore • Asks WebKit layer to load resource • Resource loading and frame loading are totally separate Network Loader Image stolen from Adam Barth’s Presentation

  10. WebCore • Fires off pre-load requests on the fly • XSS Auditor Network Loader HTML Parser

  11. WebCore • Parser generates DOM tree Network Loader HTML Parser CSS DOM Script

  12. WebCore • Create RenderObjects using “Attachment” Network Loader HTML Parser CSS DOM Script Render Tree

  13. WebCore • CSS Style Computation Network Loader HTML Parser CSS DOM Script RenderStyles Render Tree Image stolen from Adam Barth’s Presentation

  14. WebCore • CSS Style Computation Network Loader HTML Parser CSS DOM Script RenderStyles Render Tree Image stolen from Adam Barth’s Presentation

  15. WebCore Network Loader HTML Parser CSS DOM Script RenderStyles Render Tree Layout (RenderLayer, LineBoxes)

  16. WebCore graphics • Accelerated Compositing Image stolen from AriyaHidayat’sblogpost

  17. WebCore Graphics • Tiled rendering Image stolen from AriyaHidayat’sblogpost

  18. WebCore Directory structure is insightful • bindings (and idl files) • bridge • css • Dom • editing • history • html • icu • Inspector • loader • Platforms (graphics, network) • plugins • rendering • storage • svg • xml

  19. WebCore Porting • Platforms/ implements port abstraction • Networking & Graphics • Time, DnD, Themes, Clipboard, UA • Many features like plugins require port specific enhancements • Sprinkle ifdefs as necessary • Add dir/<port>/<file><port>.cpp • E.g history/qt/HistoryItemQt.cpp

  20. WebCore Porting (2) • Client interfaces • Abstract interfaces implemented by the port • Used in place of ifdef’s when it’s useful for many ports class GeolocationClient { virtual boolrequestAccess() = 0; } void Page::setClient(GeolocationClient *c) { client = c; } bool Page::requestLocationAccess() { return client->requestAccess(); } // Qt class GeolocationClientQt : public GeolocationClient { … } … page->setClient(new GeolocationClientQt);

  21. WebCore • Modules (battery, gelocation, indexeddb..) • Layout tests • Unit tests

  22. WebKit • Platform specific code • APIs • WebCoreSupport

  23. WebKit2 • New async API that uses split process model • Developed by Apple

  24. WebKit2 Image taken from WebKit Wiki

  25. WebKit2 vs Chrome Image taken from WebKit Wiki

  26. Trying out WebKit • WebKit has no releases • Each port is compiled differently git.webkit.org

  27. Thank you • Questions?

More Related