Trait style::dom::TDocument
[−]
[src]
pub trait TDocument: Sized + Copy + Clone { type ConcreteNode: TNode<ConcreteDocument = Self>; fn as_node(&self) -> Self::ConcreteNode; fn is_html_document(&self) -> bool; fn quirks_mode(&self) -> QuirksMode; fn elements_with_id(
&self,
_id: &Atom
) -> Result<&[<Self::ConcreteNode as TNode>::ConcreteElement], ()> { ... } }
The TDocument
trait, to represent a document node.
Associated Types
type ConcreteNode: TNode<ConcreteDocument = Self>
The concrete TNode
type.
Required Methods
fn as_node(&self) -> Self::ConcreteNode
Get this document as a TNode
.
fn is_html_document(&self) -> bool
Returns whether this document is an HTML document.
fn quirks_mode(&self) -> QuirksMode
Returns the quirks mode of this document.
Provided Methods
fn elements_with_id(
&self,
_id: &Atom
) -> Result<&[<Self::ConcreteNode as TNode>::ConcreteElement], ()>
&self,
_id: &Atom
) -> Result<&[<Self::ConcreteNode as TNode>::ConcreteElement], ()>
Get a list of elements with a given ID in this document, sorted by document position.
Can return an error to signal that this list is not available, or also return an empty slice.