pub enum HtmlDomNode {
DomSpan(Span<HtmlDomNode>),
Anchor(Anchor),
Img(Img),
Symbol(SymbolNode),
SvgNode(SvgNode),
MathML(MathNode),
Fragment(HtmlDomFragment),
}
Expand description
Recursive HTML DOM node enum with tuple variants
Variants§
DomSpan(Span<HtmlDomNode>)
Span wrapping other DOM nodes
Anchor(Anchor)
Anchor (<a>
) element with hyperlink
Img(Img)
Image embed (<img>
) element
Symbol(SymbolNode)
Symbol node containing information about a single symbol
SvgNode(SvgNode)
SVG node for rendering stretchy wide elements
MathML(MathNode)
MathML node for mathematical expressions
Fragment(HtmlDomFragment)
Document fragment containing HTML DOM nodes
Implementations§
Source§impl HtmlDomNode
Helper methods for HtmlDomNode to maintain API compatibility
impl HtmlDomNode
Helper methods for HtmlDomNode to maintain API compatibility
These methods provide a unified interface for accessing properties of different HTML DOM node types. Not all node types support all properties - for example, SVG and MathML nodes don’t have traditional CSS classes or dimensions.
Sourcepub const fn classes(&self) -> &ClassList
pub const fn classes(&self) -> &ClassList
Get the CSS classes applied to this node
Returns an empty class list for node types that don’t support CSS classes (SvgNode, MathML). For other node types, returns their class list.
Sourcepub const fn classes_mut(&mut self) -> Option<&mut ClassList>
pub const fn classes_mut(&mut self) -> Option<&mut ClassList>
Try to mutate the CSS classes applied to this node
Returns Some(&mut ClassList)
for node types that support mutable CSS
classes, or None
for node types that don’t support CSS classes
(SvgNode, MathML).
Sourcepub const fn height(&self) -> f64
pub const fn height(&self) -> f64
Get the height of this node
Returns the vertical height above the baseline in em units. For node types that don’t have a defined height (SvgNode, MathML), returns 0.0.
Sourcepub const fn height_mut(&mut self) -> Option<&mut f64>
pub const fn height_mut(&mut self) -> Option<&mut f64>
Try to set the height of this node
Returns Some(&mut f64)
for node types that support mutable height,
or None
for node types that don’t have a defined height (SvgNode,
MathML).
Sourcepub const fn depth(&self) -> f64
pub const fn depth(&self) -> f64
Get the depth of this node
Returns the vertical depth below the baseline in em units. For node types that don’t have a defined depth (SvgNode, MathML), returns 0.0.
Sourcepub const fn depth_mut(&mut self) -> Option<&mut f64>
pub const fn depth_mut(&mut self) -> Option<&mut f64>
Try to set the depth of this node
Returns Some(&mut f64)
for node types that support mutable depth,
or None
for node types that don’t have a defined depth (SvgNode,
MathML).
Sourcepub const fn max_font_size(&self) -> f64
pub const fn max_font_size(&self) -> f64
Get the maximum font size used in this node
Returns the largest font size used within this node and its children in em units. For node types that don’t have a defined max_font_size (SvgNode, MathML), returns 0.0.
Sourcepub const fn max_font_size_mut(&mut self) -> Option<&mut f64>
pub const fn max_font_size_mut(&mut self) -> Option<&mut f64>
Try to set the maximum font size of this node
Returns Some(&mut f64)
for node types that support mutable
max_font_size, or None
for node types that don’t have a defined
max_font_size (SvgNode, MathML).
Sourcepub const fn width(&self) -> Option<f64>
pub const fn width(&self) -> Option<f64>
Get the width of this node
Returns the horizontal width in em units, or None
if the node doesn’t
have a defined width. Most node types don’t have a defined width,
with Symbol being the primary exception.
Sourcepub const fn style(&self) -> Option<&CssStyle>
pub const fn style(&self) -> Option<&CssStyle>
Get the inline CSS style object
Returns a reference to the CSS style properties applied to this node. For node types that don’t support inline styles (SvgNode, MathML), returns an empty style object.
Sourcepub const fn style_mut(&mut self) -> Option<&mut CssStyle>
pub const fn style_mut(&mut self) -> Option<&mut CssStyle>
Get a mutable reference to the inline CSS style object
Returns a mutable reference to the CSS style properties applied to this node. For node types that don’t support inline styles (SvgNode, MathML), returns an empty style object.
Trait Implementations§
Source§impl Clone for HtmlDomNode
impl Clone for HtmlDomNode
Source§fn clone(&self) -> HtmlDomNode
fn clone(&self) -> HtmlDomNode
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for HtmlDomNode
impl Debug for HtmlDomNode
Source§impl From<Anchor> for HtmlDomNode
impl From<Anchor> for HtmlDomNode
Source§impl From<DocumentFragment<HtmlDomNode>> for HtmlDomNode
impl From<DocumentFragment<HtmlDomNode>> for HtmlDomNode
Source§fn from(fragment: HtmlDomFragment) -> Self
fn from(fragment: HtmlDomFragment) -> Self
Source§impl From<Span<HtmlDomNode>> for HtmlDomNode
impl From<Span<HtmlDomNode>> for HtmlDomNode
Source§impl From<SymbolNode> for HtmlDomNode
impl From<SymbolNode> for HtmlDomNode
Source§fn from(symbol: SymbolNode) -> Self
fn from(symbol: SymbolNode) -> Self
Source§impl VirtualNode for HtmlDomNode
Implement VirtualNode for HtmlDomNode
impl VirtualNode for HtmlDomNode
Implement VirtualNode for HtmlDomNode