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

The dependency selector.

The offset into the selector that we should match on.

Methods

impl Dependency
[src]

[src]

Returns the combinator to the right of the partial selector this dependency represents.

TODO(emilio): Consider storing inline if it helps cache locality?

[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.

[src]

Whether this dependency may affect style of any of our descendants.

[src]

Whether this dependency may affect style of any of our later siblings.

Trait Implementations

impl Clone for Dependency
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Dependency
[src]

[src]

Formats the value using the given formatter. Read more

impl MallocSizeOf for Dependency
[src]

[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>
[src]

Gets the selector we should use to index in the selector map.