Skip to main content

set_inner_html

Function set_inner_html 

Source
pub fn set_inner_html(
    doc: &mut BaseDocument,
    node: NodeId,
    html: &str,
) -> Result<()>
Expand description

element.innerHTML = html.

Existing children are detached rather than dropped, so wrappers a runtime still holds for them stay valid. That detach is the only part of this operation the facade performs.

Parsing is the document’s job, not this crate’s. The new children come from BaseDocument::html_parser_provider, and the default provider, blitz_dom::DummyHtmlParserProvider, parses nothing at all: against a document built with DocumentConfig::default() this call empties the element and stops. An embedder that wants innerHTML to work configures blitz-html’s provider. This crate does not depend on blitz-html, so it cannot check for you.