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.
key_code
A key’s place on the keyboard, named as the DOM names it (KeyboardEvent.code), for the keys whose meaning a layout changes: the letters, digits and punctuation. Named keys (Enter, the arrows) mean the same on every layout and travel by name alone.
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
ExtensionActionChange
What an extension changed of its toolbar button (chrome.action). Each field is None when it did not change; Some(None) takes back what it set for one tab, so that tab shows what every tab shows.
ExtensionNotice
What an extension’s notification (chrome.notifications) shows.
ExtensionPermissionSet
API permissions and site patterns, as chrome.permissions names a set of them.
ExtensionShortcut
A key one of extensions’ commands holds (commands in a manifest), as Chrome names it (“Y”, “9”, “Comma”, “Up”), with its modifiers: meta is Command on macOS.
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.
FrameDamage
Where a frame differs from the ones its engine made before it: a view that drew one of those repaints, and uploads, only there.
FrameId
A frame’s place in the page: the id its parent’s outline printed, a dot between the numbers of nested frames (2, then 2.1), at most eight deep.
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.
OmniboxSuggestion
One suggestion an extension made for what follows its keyword: what choosing it enters, and what it says, in Chrome’s markup (<match>, <dim>, <url>).
PageDialog
A question the page waits on until it is answered with WebViewCommand::AnswerPageDialog, or the engine says it no longer waits (WebViewEvent::PageDialogClosed). Everything but id and kind is the page’s own text.
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.
PixelRect
A rect of a frame, in its pixels.
PointerStep
One step of a PageRequest::Pointer gesture.
Popup
A popup window a page opened, with the size it asked for (0 when it named none), in CSS pixels.
ServiceSessionReply
Import completion proves storage writes, never provider authentication.
ServiceSessionRequest
SiteStatus
Bounded snapshot for one committed top-level origin and document generation.
TextField
The page’s focused editable field, as an engine reports it for the platform input method: what it takes, and where on the page it and the text being composed in it are, so the input method’s candidates appear where the person types.

Enums§

ContextMenuItem
A row of a page’s context menu, as the engine offers it.
CredentialAction
ExtensionActionIcon
An icon an extension gave its toolbar button.
ExtensionMenuItem
A row of an extension’s toolbar button menu (chrome.contextMenus items made for its button), chosen by key (WebViewCommand::ExtensionMenuChoice).
ExtensionSidePanelChange
What an extension asks of its side panel beside a tab’s page; each address is among the extension’s own pages.
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
OmniboxInput
What the person did in the Browser’s address after an extension’s keyword (the manifest’s omnibox), which the extension hears of as in Chrome (chrome.omnibox).
PageDialogKind
What a page asks with a dialog of its own.
PageNavigation
Whether a page request led the page to another document, as far as the engine can tell when it answers.
PageRequest
PointerButton
PointerPoint
Where a step happens: inside an element’s box or at a viewport point.
PointerStepKind
ScrollTarget
Where a PageRequest::Scroll goes instead of a distance.
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.

Constants§

BROWSER_APP_ID
The Browser’s app id: the app the desktop opens a web address in when nothing else is chosen for it.
MAX_PAGE_DIALOG_ANSWER
The longest answer to a page’s prompt an engine takes, in bytes.
MAX_POINTER_STEPS
Upper bound on the steps of one pointer gesture.
VISITOR_WINDOW_FLAG
The switch a Browser window is launched with when it is opened for an agent ([runtime_portal::windows::VISITOR_WINDOW_FLAG]). Reading such a page takes no authority beyond a visitor’s. A launch switch is part of the local window door, so the portable toolkit, which no launcher starts, has none.

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.

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.