Web browser architecture

Nguyen Quang
Nguyen QuangR&D Center Leader at 솔트룩스
Web-Browser Architecture
2015.05
1
The browser's main components
2
The browser's main components
• The User Interface: provides the methods
with which a user inter-acts with the Browser
Engine. This includes the address bar,
back/forward button, bookmarking menu, etc.
Every part of the browser display except the
window where you see the requested page.
3
The browser's main components
• The Browser Engine: marshals actions
between the UI and the rendering engine. This
provides a high-level interface to the
Rendering Engine. The Browser Engine
provides methods to initiate the loading of a
URL and other high-level browsing actions
(reload, back, forward). The Browser Engine
also provides the User interface with various
messages relating to error messages and
loading progress.
4
The browser's main components
• The Rendering Engine: produces the visual
representation of a given URL. The Rendering
Engine interprets the HTML, XML, and
JavaScript that comprises a given URL and
generates the layout that is displayed in the
User Interface. A key component of the
Rendering Engine is the HTML parser, this
HTML parser is quite complex because it
allows the Rendering Engine to display poorly
formed HTML pages
5
The browser's main components
• The Rendering Engine: Different browsers use
different rendering engines: Internet Explorer
uses Trident, Firefox uses Gecko, Safari uses
WebKit. Chrome and Opera uses WebKit
(before is Blink).
6
The browser's main components
• The Networking: provides functionality to
handle retrieve URLs using the common
Internet protocols of HTTP and FTP. The
Networking components handles all aspects of
Internet communication and security,
character set translations and MIME type
resolution. The Network component may
implement a cache of retrieved documents to
minimize network traffic.
7
The browser's main components
• The JavaScript Interpreter: component
executes the JavaScript code that is embedded
in a website. Results of the execution a passed
to the Rendering Engine for display. The
Rendering Engine may disable various actions
based on user defined properties.
8
The browser's main components
• The UI Backend:
– Used for drawing basic widgets like combo boxes
and windows
– Underneath it uses operating system user
interface methods.
9
The browser's main components
• The Data Storage: manages user data such as
bookmarks, cookies and preferences. The new
HTML specification (HTML5) defines 'web
database' which is a complete (although light)
database in the browser.
10
The browser's main components
It is important to note that browsers such as
Chrome run multiple instances of the rendering
engine: one for each tab. Each tab runs in a
separate process.
11
Architecture of Firefox
Rendering Engine: Gecko
XML Parser: Expat
JavaScript Interpreter:
Spider-Monkey, implement
in C
12
Architecture of Chrome
Rendering Engine:
Used the WebKit until
v27, from v28 user
WebKit fork Blink
XML Parser:
libXML to parse XML
libXSLT to handle XSLT
JavaScript Interpreter: V8
JavaScript Engine, writen
in C++
13
Architecture of IE
14
Architecture of IE
• IExplore
• Browsui
• Shdocvw
• Mshtml
• Urlmon
• WinInet
15
Rendering Engine
16
Rendering Engine – Basic flow
• Step 1: Parsing the HTML document and
convert elements to DOM nodes in a tree
called the “content tree” – HTML Parser
• Step 2: Parse the style data, both in external
CSS files and in style element together with
visual instructions in HTML will be used to
create another tree, call “render tree” – CSS
Parser
17
Rendering Engine – Basic flow
• Step 3: After the construction of the render
tree it goes through a “layout" process. This
means giving each node the exact coordinates
where it should appear on the screen
• Step 4: The next stage is painting–the render
tree will be traversed and each node will be
painted using the UI backend layer - Painting.
18
Rendering Engine
WebKit main flow
19
Rendering Engine
Gecko main flow
20
Rendering Engine Keys
• HTML Parser: The job of the HTML parser is to
parse the HTML markup into a parse tree.
• DOM: The output tree (the "parse tree") is a
tree of DOM element and attribute nodes.
• CSS Parsing: CSS is a context free grammar
and can be parsed using the types of parsers
described in the introduction. In fact the CSS
specification defines CSS lexical and syntax
grammar.
21
Primary Rendering Engine
22
WebKit Rendering Engine
Is an open source project to layout web pages, taken from Apple.
23
WebKit Rendering Engine
• WebKit embedding API: interface between
rendering engine and Browser UI
• WebCore: is application logic: loading, parsing,
layout, style resolution, painting, event handling,
editing, javascript bindings
• JSCore (JavaScript Engine): V8 or JavaScriptCore,
parses and executes page logic allows DOM
manipulation
• Platform API: Network stack, Graphics library, Font
engine, Native widgets …
24
Five ports of WebKit
Chrome
(OS X)
Safari
(OS X)
QtWebKit
Android
Browser
Chrome for
iOS
Rendering Skia CoreGraphics QtGui Android stack/Skia CoreGraphics
Networking
Chromium
network stack
CFNetwork QtNetwork
Fork of Chromium’s
network stack
Chromium stack
Fonts
CoreText via
Skia
CoreText Qt internals Android stack CoreText
JavaScript V8 JavaScriptCore
JSC (V8 is used
elsewhere in Qt)
V8
JavaScriptCore
(without JITting) *
25
Gecko Rendering Engine
26
Gecko Components
• Document Parser (HTML & XML Parser)
• Style System: contains the CSS Parser and is
responsible for getting the CSS data from
Necko and parsing it before sending it to the
frame constructor
• Platform-Specific Rendering and Widgets
• Image Library: Interacts with Necko in order
to retrieve image data before sending it to the
Frame Constructor
27
Gecko Components
• Content Model: Interacts with the various
components of Gecko, DOM Storage to gather
all the data needed before sending it to the
frame constructor
• Frame Constructor: Carries out the task of
piece together all the information and actually
from the rendered web page before sending it
back to the UI through the Platform-Specific
Rendering subsystem
28
Fork (software development)
In software engineering, a project fork happens when
developers take a copy of source code from one
software package and start independent development
on it, creating a distinct and separate piece of software.
The term often implies not merely a development
branch, but a split in the developer community, a form
of schism
29
Blink (layout engine)
• Blink is a web browser engine developed as part of
the Chromium project by Google with contributions
from Opera Software ASA, Intel, Samsung and others
• It was first announced in April 2013
• It is a fork of the WebCore component of WebKit
and is used in Chrome starting at version 28, Opera
(15+), Amazon Silk and other Chromium based
browsers as well as Android's (4.4+) WebView and
Qt's WebEngine
30
Comparison
• http://en.wikipedia.org/wiki/Comparison_of_layout_engines_(HTML)
• http://en.wikipedia.org/wiki/Comparison_of_web_browser_engines
31
Resource
• https://blogs.library.duke.edu/digital-collections/2009/02/13/on-the-trident-project-part-1-
architecture/
• http://rakshasingh.weebly.com/working-of-browser-engine.html
• http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/
• http://www.smashingmagazine.com/2015/01/26/inside-microsofts-new-rendering-engine-
project-spartan/
• http://techcrunch.com/2013/04/03/google-forks-webkit-and-launches-blink-its-own-
rendering-engine-that-will-soon-power-chrome-and-chromeos/
• http://www.sitepoint.com/microsoft-drop-trident-from-internet-explorer/
• https://books.google.com.vn/books?id=D-
5eDyiUQDQC&pg=PA269&lpg=PA269&dq=internet+explorer+8+%26+9+development+pdf&s
ource=bl&ots=Is1gnQScSW&sig=qpf25cDzPyOtDofnY47o_VS1pXI&hl=vi&sa=X&ei=XqJdVeX_
DcmA8gX6ioDYAQ&redir_esc=y#v=onepage&q=internet%20explorer%208%20%26%209%20
development%20pdf&f=false
32
1 of 32

Recommended

Dynamic HTML (DHTML) by
Dynamic HTML (DHTML)Dynamic HTML (DHTML)
Dynamic HTML (DHTML)Himanshu Kumar
9.5K views19 slides
Javascript by
JavascriptJavascript
JavascriptManav Prasad
53.8K views58 slides
Web Design Notes by
Web Design NotesWeb Design Notes
Web Design Notesbutest
41.8K views11 slides
Html ppt by
Html pptHtml ppt
Html pptsantosh lamba
10.3K views39 slides
Architecture of the Web browser by
Architecture of the Web browserArchitecture of the Web browser
Architecture of the Web browserSabin Buraga
20.1K views30 slides
Presentation on HTML by
Presentation on HTMLPresentation on HTML
Presentation on HTMLsatvirsandhu9
40.2K views19 slides

More Related Content

What's hot

Learn html Basics by
Learn html BasicsLearn html Basics
Learn html BasicsMcSoftsis
31.9K views35 slides
Introduction to CSS by
Introduction to CSSIntroduction to CSS
Introduction to CSSAmit Tyagi
45.3K views25 slides
Unit 1 introduction to web programming by
Unit 1 introduction to web programmingUnit 1 introduction to web programming
Unit 1 introduction to web programmingzahid7578
943 views32 slides
Web browser architecture.87 to 88 by
Web browser architecture.87 to 88Web browser architecture.87 to 88
Web browser architecture.87 to 88myrajendra
3.4K views23 slides
screen output and keyboard input in js by
screen output and keyboard input in jsscreen output and keyboard input in js
screen output and keyboard input in jschauhankapil
3.1K views8 slides
Html Ppt by
Html PptHtml Ppt
Html Pptvijayanit
221.8K views22 slides

What's hot(20)

Learn html Basics by McSoftsis
Learn html BasicsLearn html Basics
Learn html Basics
McSoftsis31.9K views
Introduction to CSS by Amit Tyagi
Introduction to CSSIntroduction to CSS
Introduction to CSS
Amit Tyagi45.3K views
Unit 1 introduction to web programming by zahid7578
Unit 1 introduction to web programmingUnit 1 introduction to web programming
Unit 1 introduction to web programming
zahid7578943 views
Web browser architecture.87 to 88 by myrajendra
Web browser architecture.87 to 88Web browser architecture.87 to 88
Web browser architecture.87 to 88
myrajendra3.4K views
screen output and keyboard input in js by chauhankapil
screen output and keyboard input in jsscreen output and keyboard input in js
screen output and keyboard input in js
chauhankapil3.1K views
Html Ppt by vijayanit
Html PptHtml Ppt
Html Ppt
vijayanit221.8K views
HTML and XML Difference FAQs by Umar Ali
HTML and XML Difference FAQsHTML and XML Difference FAQs
HTML and XML Difference FAQs
Umar Ali2.7K views
Token, Pattern and Lexeme by A. S. M. Shafi
Token, Pattern and LexemeToken, Pattern and Lexeme
Token, Pattern and Lexeme
A. S. M. Shafi10.6K views
Windows Architecture Explained by Stacksol by Stacksol
Windows Architecture Explained by StacksolWindows Architecture Explained by Stacksol
Windows Architecture Explained by Stacksol
Stacksol36.9K views
Developing an ASP.NET Web Application by Rishi Kothari
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
Rishi Kothari28.4K views
Types of Operating System by Hemant Raj
Types of Operating SystemTypes of Operating System
Types of Operating System
Hemant Raj90.4K views
Integrated Development Environments (IDE) by SeanPereira2
Integrated Development Environments (IDE) Integrated Development Environments (IDE)
Integrated Development Environments (IDE)
SeanPereira22.3K views
Html Slide Part-1 by AAKASH KUMAR
Html Slide Part-1Html Slide Part-1
Html Slide Part-1
AAKASH KUMAR2.4K views

Similar to Web browser architecture

Rendering engine by
Rendering engineRendering engine
Rendering engineDharita Chokshi
3K views20 slides
How browsers work landscape by
How browsers work landscapeHow browsers work landscape
How browsers work landscapeanandkishore
1.3K views57 slides
Transforming the web into a real application platform by
Transforming the web into a real application platformTransforming the web into a real application platform
Transforming the web into a real application platformMohanadarshan Vivekanandalingam
616 views29 slides
How Browsers Work -By Tali Garsiel and Paul Irish by
How Browsers Work -By Tali Garsiel and Paul IrishHow Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul IrishNagamurali Reddy
314 views51 slides
Lecture 1 (2) by
Lecture 1 (2)Lecture 1 (2)
Lecture 1 (2)erick chuwa
124 views102 slides
Asp net by
Asp netAsp net
Asp netDr. C.V. Suresh Babu
1.2K views31 slides

Similar to Web browser architecture(20)

How browsers work landscape by anandkishore
How browsers work landscapeHow browsers work landscape
How browsers work landscape
anandkishore1.3K views
How Browsers Work -By Tali Garsiel and Paul Irish by Nagamurali Reddy
How Browsers Work -By Tali Garsiel and Paul IrishHow Browsers Work -By Tali Garsiel and Paul Irish
How Browsers Work -By Tali Garsiel and Paul Irish
Nagamurali Reddy314 views
Develop a Quick and Dirty Web interface to your database: for the DBA and oth... by Gabriel Villa
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Develop a Quick and Dirty Web interface to your database: for the DBA and oth...
Gabriel Villa1.8K views
Creating Effective Web Pages Creating HTML Documents by webhostingguy
Creating Effective Web Pages Creating HTML Documents Creating Effective Web Pages Creating HTML Documents
Creating Effective Web Pages Creating HTML Documents
webhostingguy435 views
Webdesigningandpublishingcomputerstudiestheorylesson 101212054612-phpapp02 by Harshith Rockx
Webdesigningandpublishingcomputerstudiestheorylesson 101212054612-phpapp02Webdesigningandpublishingcomputerstudiestheorylesson 101212054612-phpapp02
Webdesigningandpublishingcomputerstudiestheorylesson 101212054612-phpapp02
Harshith Rockx188 views
project_proposal_osrf by om1234567890
project_proposal_osrfproject_proposal_osrf
project_proposal_osrf
om1234567890240 views
How webpage loading takes place? by Abhishek Mitra
How webpage loading takes place?How webpage loading takes place?
How webpage loading takes place?
Abhishek Mitra95 views
Internet Explorer 9 by Vasu Jain
Internet Explorer 9Internet Explorer 9
Internet Explorer 9
Vasu Jain1.2K views

More from Nguyen Quang

Apache Zookeeper by
Apache ZookeeperApache Zookeeper
Apache ZookeeperNguyen Quang
2K views26 slides
Apache Storm by
Apache StormApache Storm
Apache StormNguyen Quang
1.2K views21 slides
Deep Reinforcement Learning by
Deep Reinforcement LearningDeep Reinforcement Learning
Deep Reinforcement LearningNguyen Quang
266 views27 slides
Deep Dialog System Review by
Deep Dialog System ReviewDeep Dialog System Review
Deep Dialog System ReviewNguyen Quang
711 views26 slides
Sequence to Sequence Learning with Neural Networks by
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural NetworksNguyen Quang
2.3K views42 slides
Introduction to cassandra by
Introduction to cassandraIntroduction to cassandra
Introduction to cassandraNguyen Quang
4.7K views37 slides

More from Nguyen Quang(13)

Deep Reinforcement Learning by Nguyen Quang
Deep Reinforcement LearningDeep Reinforcement Learning
Deep Reinforcement Learning
Nguyen Quang266 views
Deep Dialog System Review by Nguyen Quang
Deep Dialog System ReviewDeep Dialog System Review
Deep Dialog System Review
Nguyen Quang711 views
Sequence to Sequence Learning with Neural Networks by Nguyen Quang
Sequence to Sequence Learning with Neural NetworksSequence to Sequence Learning with Neural Networks
Sequence to Sequence Learning with Neural Networks
Nguyen Quang2.3K views
Introduction to cassandra by Nguyen Quang
Introduction to cassandraIntroduction to cassandra
Introduction to cassandra
Nguyen Quang4.7K views
X Query for beginner by Nguyen Quang
X Query for beginnerX Query for beginner
X Query for beginner
Nguyen Quang1.1K views
Redistributable introtoscrum by Nguyen Quang
Redistributable introtoscrumRedistributable introtoscrum
Redistributable introtoscrum
Nguyen Quang746 views
A holistic lexicon based approach to opinion mining by Nguyen Quang
A holistic lexicon based approach to opinion miningA holistic lexicon based approach to opinion mining
A holistic lexicon based approach to opinion mining
Nguyen Quang1.2K views
Overview of NoSQL by Nguyen Quang
Overview of NoSQLOverview of NoSQL
Overview of NoSQL
Nguyen Quang1.4K views

Recently uploaded

MS PowerPoint.pptx by
MS PowerPoint.pptxMS PowerPoint.pptx
MS PowerPoint.pptxLitty Sylus
5 views14 slides
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs by
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDeltares
10 views17 slides
Generic or specific? Making sensible software design decisions by
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisionsBert Jan Schrijver
6 views60 slides
Fleet Management Software in India by
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India Fleetable
11 views1 slide
nintendo_64.pptx by
nintendo_64.pptxnintendo_64.pptx
nintendo_64.pptxpaiga02016
5 views7 slides
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Lisi Hocke
35 views124 slides

Recently uploaded(20)

DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs by Deltares
DSD-INT 2023 The Danube Hazardous Substances Model - KovacsDSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
DSD-INT 2023 The Danube Hazardous Substances Model - Kovacs
Deltares10 views
Generic or specific? Making sensible software design decisions by Bert Jan Schrijver
Generic or specific? Making sensible software design decisionsGeneric or specific? Making sensible software design decisions
Generic or specific? Making sensible software design decisions
Fleet Management Software in India by Fleetable
Fleet Management Software in India Fleet Management Software in India
Fleet Management Software in India
Fleetable11 views
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium... by Lisi Hocke
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Team Transformation Tactics for Holistic Testing and Quality (Japan Symposium...
Lisi Hocke35 views
FIMA 2023 Neo4j & FS - Entity Resolution.pptx by Neo4j
FIMA 2023 Neo4j & FS - Entity Resolution.pptxFIMA 2023 Neo4j & FS - Entity Resolution.pptx
FIMA 2023 Neo4j & FS - Entity Resolution.pptx
Neo4j8 views
Airline Booking Software by SharmiMehta
Airline Booking SoftwareAirline Booking Software
Airline Booking Software
SharmiMehta6 views
Software evolution understanding: Automatic extraction of software identifier... by Ra'Fat Al-Msie'deen
Software evolution understanding: Automatic extraction of software identifier...Software evolution understanding: Automatic extraction of software identifier...
Software evolution understanding: Automatic extraction of software identifier...
Sprint 226 by ManageIQ
Sprint 226Sprint 226
Sprint 226
ManageIQ5 views
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft... by Deltares
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
DSD-INT 2023 Process-based modelling of salt marsh development coupling Delft...
Deltares7 views
Dapr Unleashed: Accelerating Microservice Development by Miroslav Janeski
Dapr Unleashed: Accelerating Microservice DevelopmentDapr Unleashed: Accelerating Microservice Development
Dapr Unleashed: Accelerating Microservice Development
Miroslav Janeski10 views
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra... by Marc Müller
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra....NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
.NET Developer Conference 2023 - .NET Microservices mit Dapr – zu viel Abstra...
Marc Müller40 views
Myths and Facts About Hospice Care: Busting Common Misconceptions by Care Coordinations
Myths and Facts About Hospice Care: Busting Common MisconceptionsMyths and Facts About Hospice Care: Busting Common Misconceptions
Myths and Facts About Hospice Care: Busting Common Misconceptions
AI and Ml presentation .pptx by FayazAli87
AI and Ml presentation .pptxAI and Ml presentation .pptx
AI and Ml presentation .pptx
FayazAli8712 views
SUGCON ANZ Presentation V2.1 Final.pptx by Jack Spektor
SUGCON ANZ Presentation V2.1 Final.pptxSUGCON ANZ Presentation V2.1 Final.pptx
SUGCON ANZ Presentation V2.1 Final.pptx
Jack Spektor23 views
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx by animuscrm
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
2023-November-Schneider Electric-Meetup-BCN Admin Group.pptx
animuscrm15 views
tecnologia18.docx by nosi6702
tecnologia18.docxtecnologia18.docx
tecnologia18.docx
nosi67025 views

Web browser architecture

  • 2. The browser's main components 2
  • 3. The browser's main components • The User Interface: provides the methods with which a user inter-acts with the Browser Engine. This includes the address bar, back/forward button, bookmarking menu, etc. Every part of the browser display except the window where you see the requested page. 3
  • 4. The browser's main components • The Browser Engine: marshals actions between the UI and the rendering engine. This provides a high-level interface to the Rendering Engine. The Browser Engine provides methods to initiate the loading of a URL and other high-level browsing actions (reload, back, forward). The Browser Engine also provides the User interface with various messages relating to error messages and loading progress. 4
  • 5. The browser's main components • The Rendering Engine: produces the visual representation of a given URL. The Rendering Engine interprets the HTML, XML, and JavaScript that comprises a given URL and generates the layout that is displayed in the User Interface. A key component of the Rendering Engine is the HTML parser, this HTML parser is quite complex because it allows the Rendering Engine to display poorly formed HTML pages 5
  • 6. The browser's main components • The Rendering Engine: Different browsers use different rendering engines: Internet Explorer uses Trident, Firefox uses Gecko, Safari uses WebKit. Chrome and Opera uses WebKit (before is Blink). 6
  • 7. The browser's main components • The Networking: provides functionality to handle retrieve URLs using the common Internet protocols of HTTP and FTP. The Networking components handles all aspects of Internet communication and security, character set translations and MIME type resolution. The Network component may implement a cache of retrieved documents to minimize network traffic. 7
  • 8. The browser's main components • The JavaScript Interpreter: component executes the JavaScript code that is embedded in a website. Results of the execution a passed to the Rendering Engine for display. The Rendering Engine may disable various actions based on user defined properties. 8
  • 9. The browser's main components • The UI Backend: – Used for drawing basic widgets like combo boxes and windows – Underneath it uses operating system user interface methods. 9
  • 10. The browser's main components • The Data Storage: manages user data such as bookmarks, cookies and preferences. The new HTML specification (HTML5) defines 'web database' which is a complete (although light) database in the browser. 10
  • 11. The browser's main components It is important to note that browsers such as Chrome run multiple instances of the rendering engine: one for each tab. Each tab runs in a separate process. 11
  • 12. Architecture of Firefox Rendering Engine: Gecko XML Parser: Expat JavaScript Interpreter: Spider-Monkey, implement in C 12
  • 13. Architecture of Chrome Rendering Engine: Used the WebKit until v27, from v28 user WebKit fork Blink XML Parser: libXML to parse XML libXSLT to handle XSLT JavaScript Interpreter: V8 JavaScript Engine, writen in C++ 13
  • 15. Architecture of IE • IExplore • Browsui • Shdocvw • Mshtml • Urlmon • WinInet 15
  • 17. Rendering Engine – Basic flow • Step 1: Parsing the HTML document and convert elements to DOM nodes in a tree called the “content tree” – HTML Parser • Step 2: Parse the style data, both in external CSS files and in style element together with visual instructions in HTML will be used to create another tree, call “render tree” – CSS Parser 17
  • 18. Rendering Engine – Basic flow • Step 3: After the construction of the render tree it goes through a “layout" process. This means giving each node the exact coordinates where it should appear on the screen • Step 4: The next stage is painting–the render tree will be traversed and each node will be painted using the UI backend layer - Painting. 18
  • 21. Rendering Engine Keys • HTML Parser: The job of the HTML parser is to parse the HTML markup into a parse tree. • DOM: The output tree (the "parse tree") is a tree of DOM element and attribute nodes. • CSS Parsing: CSS is a context free grammar and can be parsed using the types of parsers described in the introduction. In fact the CSS specification defines CSS lexical and syntax grammar. 21
  • 23. WebKit Rendering Engine Is an open source project to layout web pages, taken from Apple. 23
  • 24. WebKit Rendering Engine • WebKit embedding API: interface between rendering engine and Browser UI • WebCore: is application logic: loading, parsing, layout, style resolution, painting, event handling, editing, javascript bindings • JSCore (JavaScript Engine): V8 or JavaScriptCore, parses and executes page logic allows DOM manipulation • Platform API: Network stack, Graphics library, Font engine, Native widgets … 24
  • 25. Five ports of WebKit Chrome (OS X) Safari (OS X) QtWebKit Android Browser Chrome for iOS Rendering Skia CoreGraphics QtGui Android stack/Skia CoreGraphics Networking Chromium network stack CFNetwork QtNetwork Fork of Chromium’s network stack Chromium stack Fonts CoreText via Skia CoreText Qt internals Android stack CoreText JavaScript V8 JavaScriptCore JSC (V8 is used elsewhere in Qt) V8 JavaScriptCore (without JITting) * 25
  • 27. Gecko Components • Document Parser (HTML & XML Parser) • Style System: contains the CSS Parser and is responsible for getting the CSS data from Necko and parsing it before sending it to the frame constructor • Platform-Specific Rendering and Widgets • Image Library: Interacts with Necko in order to retrieve image data before sending it to the Frame Constructor 27
  • 28. Gecko Components • Content Model: Interacts with the various components of Gecko, DOM Storage to gather all the data needed before sending it to the frame constructor • Frame Constructor: Carries out the task of piece together all the information and actually from the rendered web page before sending it back to the UI through the Platform-Specific Rendering subsystem 28
  • 29. Fork (software development) In software engineering, a project fork happens when developers take a copy of source code from one software package and start independent development on it, creating a distinct and separate piece of software. The term often implies not merely a development branch, but a split in the developer community, a form of schism 29
  • 30. Blink (layout engine) • Blink is a web browser engine developed as part of the Chromium project by Google with contributions from Opera Software ASA, Intel, Samsung and others • It was first announced in April 2013 • It is a fork of the WebCore component of WebKit and is used in Chrome starting at version 28, Opera (15+), Amazon Silk and other Chromium based browsers as well as Android's (4.4+) WebView and Qt's WebEngine 30
  • 32. Resource • https://blogs.library.duke.edu/digital-collections/2009/02/13/on-the-trident-project-part-1- architecture/ • http://rakshasingh.weebly.com/working-of-browser-engine.html • http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/ • http://www.smashingmagazine.com/2015/01/26/inside-microsofts-new-rendering-engine- project-spartan/ • http://techcrunch.com/2013/04/03/google-forks-webkit-and-launches-blink-its-own- rendering-engine-that-will-soon-power-chrome-and-chromeos/ • http://www.sitepoint.com/microsoft-drop-trident-from-internet-explorer/ • https://books.google.com.vn/books?id=D- 5eDyiUQDQC&pg=PA269&lpg=PA269&dq=internet+explorer+8+%26+9+development+pdf&s ource=bl&ots=Is1gnQScSW&sig=qpf25cDzPyOtDofnY47o_VS1pXI&hl=vi&sa=X&ei=XqJdVeX_ DcmA8gX6ioDYAQ&redir_esc=y#v=onepage&q=internet%20explorer%208%20%26%209%20 development%20pdf&f=false 32