22
Browser’s Workflow Behind the scenes of web browsers ( Not including script Interpretation )

How browser work

Embed Size (px)

DESCRIPTION

Available-Browsers, Browser-Structure Browser’s Components Rendering Engine and flow Webkit v/s Gecko

Citation preview

Page 1: How browser work

Browser’s Workflow

Behind the scenes of web browsers

( Not including script Interpretation )

Page 2: How browser work

jghj

if ( Learn the internal browser operation ) {(Development Best Practices) ++;

}

Page 3: How browser work

jghj

Content

● Browser● Available-Browsers● Statistics● Browser-Structure ● Browser’s Components● Rendering Engine and flow● Webkit v/s Gecko

Page 4: How browser work

jghj

Browser

● Present web-resources. ● Display content according to HTML and CSS

specification. (W3C Specification)● Today, mostly browser do not follow all w3c

specification.

Page 5: How browser work

jghj

HTML(4 or 5 ) specification does not define UI element. A browser must have, like file-type input variable.

Page 6: How browser work

jghj

Available-Browsers

Desktop : Chrome, FireFox, Safari , IE, Opera etc

Mobile and Tablet : Android Browser, iPhone, Opera Mini, Opera-Mobile, UC browser, Nokia S40/S60, Chrome, Firefox etc

Page 7: How browser work

jghj

Statistics

Page 8: How browser work

jghj

Statistics

Page 9: How browser work

jghj

Statistics

Page 10: How browser work

jghj

Statistics(According to state counter global state)

Desktop Usage : {Chrome, FireFox, Safari } = 71%

Mobile and Tablet Usage : {Android Browser, iPhone, Chrome} = 54 %

Page 11: How browser work

jghj

Chrome is a freeware but not open source. Chrome is derived from Chromium.

Page 12: How browser work

jghj

Browser’s high level structure

Page 13: How browser work

jghj

Browser’s Component1. The user interface:

a. Every part of the browser display, except the window. b. The address bar, back/forward button, bookmarking

menu, etc.2. The browser engine:

a. Bridge between the UI and the rendering engine.

Page 14: How browser work

jghj

Browser’s Component3. The rendering engine :

a. Parse HTML and CSS.b. Display parsed content on the screen

4. Networkinga. Network calls such as HTTP requestsb. Platform-dependent

Page 15: How browser work

jghj

Browser’s Component5. UI backend:

a. Drawing basic widgets like combo boxes and windows. b. not platform specific but use operating system user

interface methods.

Page 16: How browser work

jghj

Browser’s Component6. JavaScript interpreter

a. Used to parse and execute JavaScript code.7. Data storage

a. This is a persistence layer. b. Save all sorts of data locally, such as cookies.

Page 17: How browser work

jghj

Chrome : Each tab runs in a separate process. (multiple instances of the rendering engine)

Page 18: How browser work

jghj

Rendering Engine

● By default display only HTML, XML and image.● Beyond above things, we need extension/Add-one/Plug-ins● Rendering Engine

○ Chrome and Opera : Blink○ Chrome (iPhone) & Safari : WebKit○ Firefox : Gecko○ IE : Trident

Page 19: How browser work

jghj

Rendering Engine Main Flow..

Build Dom Tree# Get data from network Layer.# Parse HTML.# Create DOM nodes (Build by Elements).# Content Tree/ Dom Tree.# Resource(CSS) loading during parsing

Build Render Tree# Parse CSS (Inline +External).# Dom Nodes + Parsed CSS Info.# Build Render Tree.# Display start on Browse-Window.

Painting# Each node Painted. # Use UI backend Component.

Layout Process# Given coordinate to each node where they will appear. # Always start from root node(0,0).# Recursive process.

Page 20: How browser work

jghj

HTML

Style Sheets

HTML Parser

CSS Parser

DomTree

StyleRules

Attachment

Dom

RenderTree Painting

Layout

Display

HTML

Style Sheets

HTML Parser

CSS Parser

ContentTree

StyleRules

FrameConstruction

Dom

FrameTree Painting

Reflow

Display

WebKit-Flow

Gecko-Flow

Content Sink

Page 21: How browser work

jghj

● Execute script immediately when parser reach at <script> tag.

● If the script is external then first, the resource must be fetched from the network.

● In both the above cases, Parser will be on hold until script is executed.