Start of HTML doc
CSS syntax
selector { declaration block; }
Semantic elements
Display properties
Box model
Inline elements
What happens when you type google.com into your browser’s address box and press enter?
-The “g” key is pressed
OS interrupt, other behind the scenes OS behavior. In the browser, auto-complete machinery kicks into high gear, presenting suggestions based on past searches or popular searches.
-The “enter” key bottoms out
At this point, an electrical circuit specific to the enter key is closed (either directly or capacitively).
Interrupt fires [NOT for USB keyboards]
-Is it a URL or a search term?
When no protocol or valid domain name is given the browser proceeds to feed the text given in the address box to the browser’s default web search engine. In many cases the URL has a special piece of text appended to it to tell the search engine that it came from a particular browser’s URL bar.
-Convert non-ASCII Unicode characters in hostname
Since the hostname is google.com there won’t be any, but if there were the browser would apply Punycode encoding to the hostname portion of the URL.
-DNS lookup
Browswer checks its cache. if not there, calls on OS to do the lookup.. if not there then it makes a request to the DNS server configured in the network stack (local router or ISP’s caching server)
-ARP process
Address Resolution protocol. Need to know own MAC address of interface to be used, and IP address of destination.
If the computer is connected to a switch, the switch will check its local CAM/MAC table to see which port has the MAC address we are looking for. If the switch has no entry for the MAC address it will rebroadcast the ARP request to all other ports.
-Opening of a socket
Once the browser receives the IP address of the destination server, it takes that and the given port number from the URL (the HTTP protocol defaults to port 80, and HTTPS to port 443), and makes a call to the system library function named socket and requests a TCP socket stream - AF_INET/AF_INET6 and SOCK_STREAM
*This request is first passed to the Transport Layer where a
TCP segment is crafted. The destination port is added to the header, and a source port is chosen from within the kernel’s dynamic port range (ip_local_port_range in Linux).
*This segment is sent to the Network Layer, which wraps an additional IP header. The IP address of the destination server as well as that of the current machine is inserted to form a packet.
*The packet next arrives at the Link Layer. A frame header is added that includes the MAC address of the machine’s NIC as well as the MAC address of the gateway (local router). As before, if the kernel does not know the MAC address of the gateway, it must broadcast an ARP query to find it.
-HTTP protocol
Client sends HTTP request, gets response. Server responds with a response code, headers, and then the HTML payload.
-Browser
Parses HTML, CSS, and JS resources, then Renders it all (constructing the DOM, then render tree, then layout of render tree, then painting of the render tree
-Post-rendering and user-induced execution
After rendering has completed, the browser executes JavaScript code as a result of some timing mechanism (such as a Google Doodle animation) or user interaction (typing a query into the search box and receiving suggestions). Plugins such as Flash or Java may execute as well, although not at this time on the Google homepage. Scripts can cause additional network requests to be performed, as well as modify the page or its layout, causing another round of page rendering and painting.
SPDY
Google Chrome alternative to HTTP
How does SSL work?
Watch a video of this