Skip to main content

Module webview

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:

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 WebView pipeline. Off by default; enabled by setting TILO_WEBVIEW_PROFILE in the environment.
test_engine
Deterministic in-process engine used by unit tests and --shots headless 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§

AddressFields
CredentialAccount
CredentialForm
CredentialReply
CredentialRequest
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.
MediaElementInfo
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.
NavigationEntry
An actual session entry; ids are engine-owned and valid for its snapshot.
PageFailure
Why a page request did nothing. code is stable, such as stale_element, obscured or unavailable.
PageKey
One key plus modifiers, written as a chord such as Enter, Shift+Tab or Control+a.
PageReply
What a completed page request observed.
SiteStatus
Bounded snapshot for one committed top-level origin and document generation.

Enums§

CredentialAction
KeyInput
Winit-independent so engines don’t take a winit dependency.
MouseButton
NamedKey
NavigationCommand
An owned main-frame navigation. Its final URL may differ after redirects.
NavigationDirection
PageRequest
WebViewCommand
WebViewEvent
Navigation / UI state changes from the engine to the host app, folded into its own state (address bar text, title, progress) during sync.

Traits§

WebViewEngine
A running web engine instance. Implementations are Send + Sync so 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§

FrameSlot
Latest-frame mailbox between an engine and the widget. Engines overwrite the slot on every paint; the widget reads it on every draw.
SharedEngine
Shared engine handle, as stored by the widget and the host app.