gecko-dev/servo/components/style/invalidation/element
Emilio Cobos Álvarez 7ff7bc8cc2 Bug 1509418 - Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor. r=heycam,boris
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-04-23 19:20:17 +00:00
..
document_state.rs Bug 1509418 - Make Invalidation work in terms of a dependency, not a selector. r=heycam,boris 2020-04-23 19:20:10 +00:00
element_wrapper.rs
invalidation_map.rs Bug 1509418 - Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor. r=heycam,boris 2020-04-23 19:20:17 +00:00
invalidator.rs Bug 1509418 - Make Invalidation work in terms of a dependency, not a selector. r=heycam,boris 2020-04-23 19:20:10 +00:00
mod.rs
restyle_hints.rs
state_and_attributes.rs Bug 1509418 - Make Invalidation work in terms of a dependency, not a selector. r=heycam,boris 2020-04-23 19:20:10 +00:00