Module webview
Expand description
Engine-agnostic embedded web view plumbing.
The crate::widget::WebView widget displays frames produced by a
WebViewEngine backend and forwards input back into it. The engine
runs on its own thread (or entirely synchronously, for tests): commands
flow in through WebViewEngine::send, rendered pixels come out
through a shared FrameSlot, and navigation/UI state changes come
out as WebViewEvents drained by the host app during sync.
Backends:
test_engine::TestEngine— deterministic, dependency-free engine used by unit tests and--shotsheadless renders.chromium::ChromiumEngine— the Tilo system engine: a Chromium (CEF) host process rendering real pages offscreen, delivered as its own signed runtime (seechromium::runtime).
Coordinates in commands are physical pixels relative to the web view’s top-left corner — the widget does the logical→physical translation so engines never see toolkit layout space.
Modules§
- chromium
- Chromium helper transport, independent of native CEF build dependencies.
- page
- Typed requests against a live page’s content.
- paint
- The paint stream: a page as a display list instead of pixels.
- profile
- Lightweight instrumentation for the
WebViewpipeline. Off by default; enabled by settingTILO_WEBVIEW_PROFILEin the environment. - test_
engine - Deterministic in-process engine used by unit tests and
--shotsheadless renders. It loads no network content: every “page” is a flat colour derived from a stable hash of the URL, with a darker header band, so different URLs render visibly different frames and pixel assertions stay byte-stable across runs. - text_
input - Private, acknowledged edits. Neither replies nor transcripts are app events.
Structs§
- Address
Fields - Credential
Account - Credential
Form - Credential
Reply - Credential
Request - Frame
- One rendered frame from the engine: tightly-packed RGBA8 at physical pixel resolution. The buffer is shared, never copied per draw — the widget detects staleness via the allocation pointer.
- KeyModifiers
- Forwarded into the page so editing shortcuts (Ctrl+Backspace, Shift+Arrow, …) reach the web content.
- Media
Element Info - A visible media element expressed relative to the web viewport. Keeping this normalised makes it independent of physical display scale and lets browser chrome map it onto the current app surface after a resize.
- Navigation
Entry - An actual session entry; ids are engine-owned and valid for its snapshot.
- Page
Failure - Why a page request did nothing.
codeis stable, such asstale_element,obscuredorunavailable. - PageKey
- One key plus modifiers, written as a chord such as
Enter,Shift+TaborControl+a. - Page
Reply - What a completed page request observed.
- Site
Status - Bounded snapshot for one committed top-level origin and document generation.
Enums§
- Credential
Action - KeyInput
- Winit-independent so engines don’t take a winit dependency.
- Mouse
Button - Named
Key - Navigation
Command - An owned main-frame navigation. Its final URL may differ after redirects.
- Navigation
Direction - Page
Request - WebView
Command - WebView
Event - Navigation / UI state changes from the engine to the host app, folded
into its own state (address bar text, title, progress) during
sync.
Traits§
- WebView
Engine - A running web engine instance. Implementations are
Send + Syncso the widget, the host app, and the engine’s own thread can share one handle.
Functions§
- normalise_
url - Normalise user-typed address-bar input into a loadable URL: pass
through explicit schemes, otherwise treat input with spaces or
without dots as a search query and everything else as an
https://host.
Type Aliases§
- Frame
Slot - Latest-frame mailbox between an engine and the widget. Engines overwrite the slot on every paint; the widget reads it on every draw.
- Shared
Engine - Shared engine handle, as stored by the widget and the host app.