Skip to main content

Module iframe

Module iframe 

Source
Expand description

<iframe>: a document in a platform webview, drawn into the element’s box.

This module knows the tree (which <iframe> nodes exist, where their boxes are, how document events become JS events), not the webview: a Backend does, registered with set_backend. With none (Linux, no WebView2 runtime, tests) every src is answered with error.

A document exists while the element is CONNECTED and has a src/srcdoc. Attribute writes and insertion/removal [note] the node; [tick] reconciles each (create, navigate, drop). Moving the element keeps the frame: the node id is its identity. Backend events arrive on the UI thread outside any gpui frame, so the Sink queues and [tick] dispatches load/error/message.

Structs§

FrameAttrs
Placement
PointerInput
A pointer event over the visible part of the document’s box.
Sink
Callable from the UI thread at any time; never re-enters JS — the event is queued for the next [tick].

Enums§

FrameEvent
PointerKind

Constants§

MAX_FRAMES
How many documents may be open at once in the process.

Traits§

Backend
Frame

Functions§

fullscreen_active
Is an element of the app fullscreen? Then Escape is the app’s even while a document has the keyboard: it leaves fullscreen and the document does not hear it, as in a browser.
set_backend
set_unavailable
Why <iframe> has no backend, as the console and the error event say it.
shutdown
supported