pub struct RestyleWalk<'a> { /* private fields */ }Expand description
A walk down a live tree that resolves each element from scratch: from its identity, its place in the tree, and what it declares about itself, against the stylesheet. It is the first cascade’s walk over the document, one element at a time, so an element resolved here comes out as it did then, and a property nothing sets any more is unset.
Resolve an element, enter it to resolve its children,
and leave it after. Each child sees the custom
properties and inherited text its parent resolved, and ancestor
selectors match on the chain entered so far.
Implementations§
Source§impl<'a> RestyleWalk<'a>
impl<'a> RestyleWalk<'a>
Sourcepub fn new(
css: &'a Stylesheet,
media: &'a MediaContext,
ancestors: &[AncestorInfo],
) -> Self
pub fn new( css: &'a Stylesheet, media: &'a MediaContext, ancestors: &[AncestorInfo], ) -> Self
A walk whose next element is a child of ancestors (root-first);
with none, the next element is a document root. Each ancestor is
resolved on the way down, so the scope it hands on is the one the
first cascade handed on.
Sourcepub fn resolve(&mut self, node: &AncestorInfo) -> Attributes
pub fn resolve(&mut self, node: &AncestorInfo) -> Attributes
Resolve node, a child of the element entered last.
The result holds the element’s identity and every style property the cascade gave it, and nothing else.
Sourcepub fn take_warnings(&mut self) -> Vec<CssWarning>
pub fn take_warnings(&mut self) -> Vec<CssWarning>
The declarations skipped so far, deduplicated, emptying the list.