Web browsers are ubiquitous, but how do they work? This book explains, building a basic but complete web browser, from networking to JavaScript, in a thousand lines of Python.
Follow this book’s blog or Twitter for updates.
Introduction
Part 1: Drawing Graphics
Downloading Web Pages
URLs and HTTP requests
Drawing to the Screen
Creating windows and drawing to a canvas
Formatting Text
Word wrapping and line spacing
Part 2: Viewing Documents
Constructing a Document Tree
Parsing and fixing HTML
Laying Out Pages
Inline and block layout, plus the box model
Applying User Styles
Parsing and applying CSS
Handling Buttons and Links
Hyperlinks and browser chrome
Part 3: Running Applications
Sending Information to Servers
Form submission and web servers
Running Interactive Scripts
Changing the DOM and reacting to events
Saving Partial Layouts
Two-phase layout and fast rendering
Keeping Data Private
Cookies and logins, XSS and CSRF
Part 4: Modern Browsers
Adding Visual Effects
Filters and transformations
Conclusion
What Wasn’t Covered
A Changing Landscape