Skip to main content

build_layout_and_info_from_snapshot

Function build_layout_and_info_from_snapshot 

Source
pub fn build_layout_and_info_from_snapshot(
    snapshot: &DomSnapshot,
    root: NodeId,
    rule_set: &RuleSet,
    measurer: Arc<dyn TextMeasurer>,
    parent: InheritedCss,
    chain: ElementChain,
    system_color_scheme: ColorScheme,
    scripting_mode: ScriptingMode,
    images: &HashMap<String, Image>,
    audio: &HashMap<String, Arc<[u8]>>,
    write_back_sender: Option<DomWriteBack>,
) -> (LayoutNode, InfoNode)
Expand description

Builds layout and render trees from a DomSnapshot.

write_back_sender (when set) is cloned per text input so value changes are reported as (node id, value) on the channel instead of mutating the DOM directly, which allows this function to run off the UI thread.

system_color_scheme seeds the root element’s used color scheme and is used to resolve color-scheme: light dark and light-dark() values.