introduction to browser internals
DESCRIPTION
Session given in Barcamp Bangalore Monsoon 2013. barcampbangalore.org/bcb/bcb14/introduction-to-browser-internalsTRANSCRIPT
Introduction to Browser Internals
Sivasubramaniam Arunachalam
Sep 14, 2013
@sivaa_in
http://barcampbangalore.org/bcb/bcb14/introduction-to-browser-internals
http://www.w3schools.com/browsers/browsers_stats.asp
http://www.w3schools.com/browsers/browsers_stats.asp
Where do you fit?
http://upload.wikimedia.org/wikipedia/commons/thumb/8/86/Usage_share_of_web_browsers_%28Source_StatCounter%29.svg/600px-Usage_share_of_web_browsers_%28Source_StatCounter%29.svg.png
What Layout Engine will do?
• Parsing
• DOM Construction
• Resource Dispatching & Loading
• Event Handling
• Painting
• JS Bindings
The Internals
• All are Objects
• Document Object Model
<html> Root Document • <head>
• <title>
• <body>
• <h1>
Access & Manipulation
• Web 1.0 (~ 0% Dynamic)
• Web 2.0
Objects are Waiting
• DOM
Need a Language
• Java Script
OO DOM
• Members / Properties
• Methods / Behaviors
• Other Objects (recursive)
• DOT Notation
Examples:
• document.title
• Window.print()
// Create and add Reset Box
var reset_box = document.createElement(‘input’)
reset_box.type = 'reset'
document.forms[0].appendChild(reset_box)
// Change the button Label
document.getElementById("gbqfsa").innerHTML = "SAP Search"
// Change the Font Size of footer
document.getElementById("flls").style.fontSize = '2em'
// Change the branding image
document.images[1].src = "http://upload.wikimedia.org/wikipedia/en/e/e4/Logo_SAP.gif"
http://upload.wikimedia.org/wikipedia/commons/thumb/6/64/W3C_and_Internet_Explorer_box_models.svg/300px-W3C_and_Internet_Explorer_box_models.svg.png
HTTP/1.1 200 OK Content-Type: application/xhtml+xml
Content-Type: text/html
<!doctype html>
<html>
Standard Mode
<script>
defer & async
http://stackoverflow.com/questions/10808109/script-tag-async-defer
JavaScript
http://www.igvita.com/2012/06/04/chrome-networking-dns-prefetch-and-tcp-preconnect/
Chrome Internals chrome://dns chrome://omnibox/ chrome://net-internals/ chrome://predictors chrome://histograms/DNS.PrefetchResolution chrome://cache
Where to Start?
http://www.macdevcenter.com/lpt/a/4570
WebKit? Chrome? (5GB)
Thank You! [email protected]
bit.ly/sivasubramaniam bit.ly/sivaa_in
References http://www.clker.com/cliparts/6/7/0/f/o/X/birthday-cake-four-candles-md.png http://leashsstuff.blogspot.in/2011/06/browser-cartoon.html https://blog.mozilla.org/webdev/2012/05/04/how-browser-engines-work/