Trait html5ever_ext::QualNameExt
[−]
[src]
pub trait QualNameExt { fn is_unprefixed_and_html_namespace_or_none(&self) -> bool; fn is_only_local(&self, local_name: &LocalName) -> bool; fn is_only_local_of(&self, local_names: &[LocalName]) -> bool; fn can_have_children(&self) -> bool; fn text_content_should_be_escaped(&self) -> bool; fn can_collapse_whitespace(&self) -> bool; }
Additional methods to work with QualName
Required Methods
fn is_unprefixed_and_html_namespace_or_none(&self) -> bool
Is this name effectively local?
fn is_only_local(&self, local_name: &LocalName) -> bool
Is this qualified name this local-only name (no prefix, no namespace)
fn is_only_local_of(&self, local_names: &[LocalName]) -> bool
Is this qualified name on these local-only names (no prefix, no namespace)
fn can_have_children(&self) -> bool
Can this element have children?
fn text_content_should_be_escaped(&self) -> bool
Should an immediate child text node have <
, >
and &
characters escaped?
In modern HTML 5, the only common nodes which don't need this are <script>
and <style>
.
In this case, the immediate child text node's content should not contain, say, </script>
as this will cause a parse error.
fn can_collapse_whitespace(&self) -> bool
Can this element's descendant text nodes have leading, trailing and interstitial whitespace collapsed?