servo/components/style/invalidation/element
Emilio Cobos Álvarez 2b7fb519ba style: Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor.
See the comment about why this is valuable. For a selector like:

    .foo:is(.bar) > .baz

Before this patch we'd generate an Dependency for .bar like this:

    Dependency {
        selector: .bar,
        offset: 0,
        parent: Some(Dependency {
            selector: .foo:is(.bar) > .baz,
            offset: 1, // Pointing to the `>` combinator.
            parent: None,
        }),
    }

After this patch we'd generate just:

    Dependency {
        selector: .foo:is(.bar) > .baz,
        offset: 1, // Pointing to the `>` combinator.
        parent: None,
    }

This is not only less memory but also less work. The reason for that is that,
before this patch, when .bar changes, we'd look the dependency, and see there's
a parent, and then scan that, so we'd match `.bar` two times, one for the
initial dependency, and one for .foo:is(.bar).

Instead, with this we'd only check `.foo:is(.bar)` once.

Differential Revision: https://phabricator.services.mozilla.com/D71423
2020-06-04 01:50:36 +02:00
..
document_state.rs style: Make Invalidation work in terms of a dependency, not a selector. 2020-06-04 01:50:36 +02:00
element_wrapper.rs style: Allow to export a shadow part under multiple names. 2020-04-16 16:35:07 +02:00
invalidation_map.rs style: Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor. 2020-06-04 01:50:36 +02:00
invalidator.rs style: Make Invalidation work in terms of a dependency, not a selector. 2020-06-04 01:50:36 +02:00
mod.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
restyle_hints.rs Remove unused code from selector and style crates 2019-06-07 15:14:21 +02:00
state_and_attributes.rs style: Make Invalidation work in terms of a dependency, not a selector. 2020-06-04 01:50:36 +02:00