modus
Menu
On this page

The module web_engine

Freestanding shared library module combining HTTP/1.1 framing, WHATWG-subset HTML/CSS layout, and PNG/JPEG image probing so per-origin browser processes share one verified read-only engine module.

web_engine module with no entry

Hash
dd9dc129a24cc33f51b052dc65697730c9f0684e434a96169f6f08f9481346bb
Size
98304 bytes
Exports
3
Imports
0
Imported by
0
License
MIT

Freestanding shared library module combining HTTP/1.1 framing, WHATWG-subset HTML/CSS layout, and PNG/JPEG image probing so per-origin browser processes share one verified read-only engine module

FactValue
KindModules with no entry
Sourcesrc/modules/libraries/web_engine
Boot imageyes: in the boot image, 98304 bytes in this build
Build settingsnone: the defaults of the source
Importsnone
Imported bynone

Neighbours

It imports no module, and no module imports it. The module graph shows it with the other modules that have no edge.

Exports

ExportWhat it does
http_request_build(host: Text, path: Text) -> Textformats a strict RFC 9112 HTTP/1.1 GET request into result, refusing CRLF header injection and invalid paths with a typed error record
html_layout_count(html: Text, viewport_width: Integer, viewport_height: Integer) -> Integerparses an HTML document and lays out its CSS block/inline boxes within viewport_width x viewport_height, returning the layout box count
image_probe_pixels(bytes: Text) -> Integerinspects PNG or JPEG bytes and returns width * height on valid headers, or an error record on malformed/oversized images

http_request_build

http_request_build(host: , path: ) -> 

http_request_build formats a strict RFC 9112 HTTP/1.1 GET request into result, refusing CRLF header injection and invalid paths with a typed error record.

Parameters
  • host:
  • path:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/web_engine/web_engine.odin:24

html_layout_count

html_layout_count(html: , viewport_width: , viewport_height: ) -> 

html_layout_count parses an HTML document and lays out its CSS block/inline boxes within viewport_width x viewport_height, returning the layout box count.

Parameters
  • html:
  • viewport_width:
  • viewport_height:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/web_engine/web_engine.odin:36

image_probe_pixels

image_probe_pixels(bytes: ) -> 

image_probe_pixels inspects PNG or JPEG bytes and returns width * height on valid headers, or an error record on malformed/oversized images.

Parameters
  • bytes:
Result
When it fails
a negative result, and the error record
Source
src/modules/libraries/web_engine/web_engine.odin:50

Read from the source of the module, as the build reads it to describe the exports (tools/modustool/build/describe.odin).

Text wire form

A wire form of the module contract: one word of a call. The address of a slice record {address, count} of UTF-8 bytes.

Error_Record record of a module

A record of the module web_engine: 56 bytes, aligned on 8 bytes, 0 bytes of padding.

  • kindi6408 bytes
  • uniti6488 bytes
  • operationi64168 bytes
  • argumenti64248 bytes
  • valuei64328 bytes
  • limiti64408 bytes
  • foundi64488 bytes

Integer wire form

A wire form of the module contract: one word of a call. A signed integer of 64 bits, in a register.