Web Browser Engineering

Pavel Panchekha & Chris Harrelson

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.

This draft version of the book includes unfinished chapters, and those chapters make inaccurate claims, fail to match published chapters, or misbehave. Read them at your own risk.

Follow this book’s blog or Twitter for updates.

Introduction

  1. Preface
  2. Browsers and the Web
  3. History of the Web

Part 1: Drawing Graphics

  1. Downloading Web Pages
    URLs and HTTP requests
  2. Drawing to the Screen
    Creating windows and drawing to a canvas
  3. Formatting Text
    Word wrapping and line spacing

Part 2: Viewing Documents

  1. Constructing a Document Tree
    Parsing and fixing HTML
  2. Laying Out Pages
    Inline and block layout, plus the box model
  3. Applying User Styles
    Parsing and applying CSS
  4. Handling Buttons and Links
    Hyperlinks and browser chrome

Part 3: Running Applications

  1. Sending Information to Servers
    Form submission and web servers
  2. Running Interactive Scripts
    Changing the DOM and reacting to events
  3. Keeping Data Private
    Cookies and logins, XSS and CSRF

Part 4: Modern Browsers

  1. Saving Partial Layouts
    Two-phase layout and fast rendering
  2. Adding Visual Effects
    Filters and transformations
  3. Browser Rendering Architecture Concepts
    The Rendering Event Loop and Pipeline

Conclusion

  1. What Wasn’t Covered

  2. A Changing Landscape

Appendix

  1. Glossary
  2. Bibliography
One-page version of this book

Did you find this chapter useful?