mirror of
https://github.com/servo/servo.git
synced 2025-06-21 15:49:04 +01:00
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 |
||
---|---|---|
.. | ||
element | ||
media_queries.rs | ||
mod.rs | ||
stylesheets.rs |