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.

Get an email every time I publish a new chapter:

Adding your email to the list...
Success! You'll receive a welcome email shortly.
Error! Something seems to have gone wrong.

Follow this book’s blog or Twitter for updates.

Introduction

  1. Preface

  2. Preliminaries

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. Saving Partial Layouts
    Two-phase layout and fast rendering
  4. Keeping Data Private
    Cookies and logins, XSS and CSRF

Part 4: Modern Browsers

  1. Adding Visual Effects
    Filters and transformations

Conclusion

  1. What Wasn’t Covered

  2. A Changing Landscape