-
-
Notifications
You must be signed in to change notification settings - Fork 120
Architecture
Joshua Thijssen edited this page Aug 8, 2023
·
1 revision
This page describes the high-level architecture of the browser.
As of this point in time, we haven't got any idea what I want, but I want to be able to do at least the following:
-
have a UI that can run under windows and/or linux and/or mac. Preferably not electron.
-
have the UI separated from the engine so we can easily create different UI's and still use the same engine underneath.
-
have the UI do at least the following:
- have a address bar where we can type in urls
- have the UI load the url and display the page
- have a "tabbed" system, where each tab is a separate page, with separate history, cookies and such
- support cookies, localstorage (is this engine?)
- support javascript (v8) (is this engine?)
- communicate with the engine by using an API (DLL/SO, not an HTTP api)
-
have an engine that can do the following:
- receive commands from the UI (ie: load page)
- generate the canvas to show in the UI
- load a URL through HTTP 1.0 / HTTP 1.1 or HTTP 2.0
- load a URL through HTTPS
- parse the received HTML headers / body into HTML tokens
- parse the HTML tokens into a DOM (might need javascript v8 for injecting new elements during parsing)
- parse CSS into rules
Few questions we need to ask ourselves:
- Where does the painting / canvas generation reside? Is it the UI that receives the DOM or is the engine that generates the picture for the UI?
- If it's the engine, how to deal with textmode generation (text only browsing)
- cookies / localstorage etc.. where is this handled?
- what is the bare minimum we can get away with?
- Which language should we use? (GoLang, C++, Rust?)
Interesting pages:
- https://engineering.teknasyon.com/what-is-the-dom-how-does-html-rendering-happen-in-browsers-cbeb12bdfea6
- https://html.spec.whatwg.org/multipage/parsing.htm
- https://dom.spec.whatwg.org/#namespaces
- https://software.hixie.ch/utilities/js/live-dom-viewer/
- https://limpet.net/mbrubeck/2014/08/11/toy-layout-engine-2.html