Struct style::invalidation::element::invalidation_map::Dependency
[−]
[src]
pub struct Dependency { pub selector: Selector<SelectorImpl>, pub selector_offset: usize, }
Mapping between (partial) CompoundSelectors (and the combinator to their right) and the states and attributes they depend on.
In general, for all selectors in all applicable stylesheets of the form:
|a _ b _ c _ d _ e|
Where: * |b| and |d| are simple selectors that depend on state (like :hover) or attributes (like [attr...], .foo, or #foo). * |a|, |c|, and |e| are arbitrary simple selectors that do not depend on state or attributes.
We generate a Dependency for both |a _ b:X _| and |a _ b:X _ c _ d:Y _|, even though those selectors may not appear on their own in any stylesheet. This allows us to quickly scan through the dependency sites of all style rules and determine the maximum effect that a given state or attribute change may have on the style of elements in the document.
Fields
selector: Selector<SelectorImpl>
The dependency selector.
selector_offset: usize
The offset into the selector that we should match on.
Methods
impl Dependency
[src]
pub fn combinator(&self) -> Option<Combinator>
[src]
Returns the combinator to the right of the partial selector this dependency represents.
TODO(emilio): Consider storing inline if it helps cache locality?
pub fn affects_self(&self) -> bool
[src]
Whether this dependency affects the style of the element.
NOTE(emilio): pseudo-elements need to be here to account for eager pseudos, since they just grab the style from the originating element.
TODO(emilio): We could look at the selector itself to see if it's an eager pseudo, and return false here if not.
pub fn affects_descendants(&self) -> bool
[src]
Whether this dependency may affect style of any of our descendants.
pub fn affects_later_siblings(&self) -> bool
[src]
Whether this dependency may affect style of any of our later siblings.
Trait Implementations
impl Clone for Dependency
[src]
fn clone(&self) -> Dependency
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Dependency
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl MallocSizeOf for Dependency
[src]
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
[src]
Measure the heap usage of all descendant heap-allocated structures, but not the space taken up by the value itself. Read more
impl SelectorMapEntry for Dependency
[src]
ⓘImportant traits for SelectorIter<'a, Impl>fn selector(&self) -> SelectorIter<SelectorImpl>
[src]
Gets the selector we should use to index in the selector map.