pub trait ElementContext {
// Required methods
fn opaque_element(&self) -> Option<OpaqueElement>;
fn opaque_parent(&self) -> Option<OpaqueNode>;
fn get_attr(
&self,
attr: &LocalName,
namespace: &Namespace,
) -> Option<String>;
fn get_tree_counting_result(
&self,
caches: &mut TreeCountingCaches,
) -> TreeCountingResult;
}Expand description
Provides element-level context needed during style computation.
Required Methods§
Sourcefn opaque_element(&self) -> Option<OpaqueElement>
fn opaque_element(&self) -> Option<OpaqueElement>
Opaque handle to the element.
Sourcefn opaque_parent(&self) -> Option<OpaqueNode>
fn opaque_parent(&self) -> Option<OpaqueNode>
Opaque handle to the element’s parent node.
Sourcefn get_attr(&self, attr: &LocalName, namespace: &Namespace) -> Option<String>
fn get_attr(&self, attr: &LocalName, namespace: &Namespace) -> Option<String>
Return the value of the given custom attribute if it exists.
Sourcefn get_tree_counting_result(
&self,
caches: &mut TreeCountingCaches,
) -> TreeCountingResult
fn get_tree_counting_result( &self, caches: &mut TreeCountingCaches, ) -> TreeCountingResult
Traverse the siblings of the element, returning the element’s sibling-index()
and sibling-count(). Also populates caches with the sibling-index() and
sibling-count() values for all siblings of this element.