servo/components/style/invalidation
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
..
element style: Optimize invalidation by scanning the rightmost compound inside :where() and :is() with the outer visitor. 2020-06-04 01:50:36 +02:00
media_queries.rs style: Remove unnecessary mem::transmute in MediaListKey. 2019-01-13 21:58:28 +01:00
mod.rs Update MPL license to https (part 4) 2018-11-19 14:47:27 +01:00
stylesheets.rs style: Use fallible allocation for stylesheet invalidation. 2019-10-09 13:21:35 +02:00