跳到正文
Hacker News (official RSS)(browser.engineering)·· 5 天前精選品質評分76

《Web Browser Engineering》帶你用 Python 從頭打造網頁瀏覽器

Web Browser Engineering (2021)

重點導讀

網頁瀏覽器每天都在用,但從載入網頁到執行 JavaScript,中間要做哪些事不容易看懂。

  • Pavel Panchekha 和 Chris Harrelson 寫了這本書,帶讀者用幾千行 Python 做出一個基本但完整的瀏覽器。
  • 內容從下載網頁、排版文字和處理 HTML、CSS,延伸到表單、JavaScript、動畫、GPU 和無障礙功能,讓人能一步步看懂瀏覽器如何把網頁顯示出來並回應操作。

AI 伴隨問答

自備 Key 深度分析

針對這篇報導有疑問?可直接點選快捷問題或向 AI 追問背景脈絡與技術細節:

推薦理由

內容從下載網頁一路講到 JavaScript、無障礙功能與 GPU 動畫,適合用來瞭解瀏覽器各部分如何串在一起。

正文 · 原文

Pavel Panchekha & Chris Harrelson

Twitter · Blog · Discussions

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 couple thousand lines of Python.

Follow this book’s blog, Mastodon, or Twitter for updates. There’s a discussion forum for the book on Github, or you can email us directly.

Introduction

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

Part 1: Loading Pages

  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 an HTML Tree
    Parsing and fixing HTML
  2. Laying Out Pages
    Inline and block layout
  3. Applying Author 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. Adding Visual Effects
    Blending, clipping, and compositing
  2. Scheduling Tasks and Threads
    The event loop and the rendering pipeline
  3. Animating and Compositing
    Smooth animations using the GPU
  4. Making Content Accessible
    Keyboard input, zooming, and the accessibility tree
  5. Supporting Embedded Content
    Images, iframes, and scripting
  6. Reusing Previous Computation
    Invalidation, editing, and correctness
來源: Hacker News (official RSS) (browser.engineering)
開啟原文

讀者討論

理性交流 · 即時討論