The entry browser
The source src/modules/demonstrations/browser built with the setting DRAWING_THROUGH_MODULE=true. The text after this paragraph is the comment of that source.
A light web browser in one window: an address field, a history, and a page of HTML and CSS. The contract package html_css lays out and paints the page. The design: From the desktop of today to a light web browser: E. A light browser in the repository.
What it is for. It shows the path of a page from its bytes to the draw table: html_css parses the HTML into a bounded tree of nodes, reads its style sheets, resolves the cascade, lays out block, inline and flex boxes, and paints them as draw records. The window copies the records that its view shows into its own draw table. Each page is parsed under its document origin by the origin worker of that origin, and the state of one origin is refused to a page of another.
Start: start("browser") in the console.
Grants: none. The window is its one handle: the pages that it shows are built into it (modus://welcome, modus://properties, modus://guide, modus://forms). An address of HTTP or HTTPS gets a page that shows the request that the worker of its origin writes, and says that this window has no grant of the network.
What a reader sees. A window that the principal resizes, laid out by the layout tree of modus:layout. The top band: back, forward, reload, the address field in its recessed well, go, and the origin badge of the page. Under it, the bookmarks band: one button for each page built in, the page shown marked. Then the page with its scroll bar. The status band: the title of the page, its nodes and its document boxes, then the address of the link under the pointer, or what the last act did.
Keys: Enter in the address field loads its address, and in a field of a form sends the form. Page Up, Page Down, Home, End, Up and Down scroll the page; the wheel scrolls it too. Tab moves the focus.
browser module with an entry
- Hash
07dce0eb35c5f4f57f885e203fbd0dd4f0605ab5dd9dd46d3425b70a2cade80f- Size
321426 bytes- Exports
0- Imports
1- Imported by
0- License
- MIT
A light web browser in one window: an address field, a history, and a page of HTML and CSS
| Fact | Value |
|---|---|
| Kind | Modules with an entry |
| Source | src/modules/demonstrations/browser |
| Boot image | yes: in the boot image, 321426 bytes in this build |
| Build settings |
|
| Imports | |
| Imported by | none |
Neighbours
What it imports, at its left, and what imports it, at its right: the part of the module graph that touches it.
Exports
| Export | What it does |
|---|---|
entry() |
entry
entry()
- Form
- The entry of the module: one parameter, an address, fixed by the contract.
src/modules/demonstrations/browser/main.odin:654
Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).
What the root service gives it
| What | Value | As the root service says |
|---|---|---|
| Grants | none | A light browser: the pages that it shows are built into it, so its window is its one handle. |
| Other terms of its start grant set | none | |
| Budget that it asks for |
| The window is counted at its largest size: 1280 x 900 pixels, 4 bytes each, two pictures, 9 216 000 bytes, 2250 pages. A resize holds the old surface and the new one together until the compositor shows the new one, so the working memory holds a second surface at the largest size: 2250 pages. And the glyph memory of the copy of the text rendering of the drawing module, which draws its text: 354 pages (display.TEXT_MEMORY_PAGES). 2250 + 354 = 2604. The document, its style sheet, its boxes, its records and the layout tree of the window are in the memory of the module, which the tool counts. |
The start grant set is read from start_grant_sets in src/modules/system/root/start_grant_sets.odin. The stated budget is read from the constant MODULE_BUDGET of the source of the module (its line); the build adds the counted parts and writes the sum in the module (tools/modustool/build/budget_count.odin); the root service accepts it up to the largest budget of a process, and adds the limits of processor time and of log records (src/modules/system/root/budgets.odin).
