pub trait HtmlParserProvider {
// Required method
fn parse_inner_html<'m, 'doc>(
&self,
mutr: &'m mut DocumentMutator<'doc>,
element_id: NodeId,
html: &str,
);
// Provided methods
fn parse_fragment<'m, 'doc>(
&self,
mutr: &'m mut DocumentMutator<'doc>,
element_id: NodeId,
html: &str,
allow_declarative_shadow_roots: bool,
) { ... }
fn parse_document(
&self,
html: &str,
config: DocumentConfig,
) -> Box<dyn Document> { ... }
}Required Methods§
fn parse_inner_html<'m, 'doc>( &self, mutr: &'m mut DocumentMutator<'doc>, element_id: NodeId, html: &str, )
Provided Methods§
Sourcefn parse_fragment<'m, 'doc>(
&self,
mutr: &'m mut DocumentMutator<'doc>,
element_id: NodeId,
html: &str,
allow_declarative_shadow_roots: bool,
)
fn parse_fragment<'m, 'doc>( &self, mutr: &'m mut DocumentMutator<'doc>, element_id: NodeId, html: &str, allow_declarative_shadow_roots: bool, )
Parse a fragment. allow_declarative_shadow_roots is set for
setHTMLUnsafe and clear for innerHTML.
The default ignores the flag and parses the way innerHTML does, so a
parser without declarative shadow roots keeps working.
Sourcefn parse_document(
&self,
html: &str,
config: DocumentConfig,
) -> Box<dyn Document>
fn parse_document( &self, html: &str, config: DocumentConfig, ) -> Box<dyn Document>
Parse a full HTML document (e.g. the contents of an <iframe>).
The default implementation ignores the HTML and returns an empty document.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".