aboutsummaryrefslogtreecommitdiffstats
path: root/components/style/servo
diff options
context:
space:
mode:
authorEmilio Cobos Álvarez <emilio@crisal.io>2020-05-27 09:17:47 +0000
committerEmilio Cobos Álvarez <emilio@crisal.io>2020-06-04 01:50:36 +0200
commit964716f72a9e5a1c823670cdb059914c01849a41 (patch)
tree634f5e9d84067b92b7c93513ae53a9eb994ca1fd /components/style/servo
parent4cf9aeeaf775989afee836ff46543473ccc441fe (diff)
downloadservo-964716f72a9e5a1c823670cdb059914c01849a41.tar.gz
servo-964716f72a9e5a1c823670cdb059914c01849a41.zip
style: Finer grained invalidation for attribute changes.
This should help out quite a bit with uBO, which has lots of very general attribute selectors. We invalidate per attribute name rather than using a SelectorMap, which prevents matching for attribute selectors that can't have changed. The idea is that this should be generally cheaper, though there are cases where this would be a slight pesimization. For example, if there's an attribute selector like: my-specific-element[my-attribute] { /* ... */ } And you change `my-attribute` in an element that isn't a `my-specific-element`, before that the SelectorMap would've prevented us from selector-matching completely. Now we'd still run selector-matching for that (though the matching would be pretty cheap). However I think this should speed up things generally, let's see what the perf tests think before landing this though. Differential Revision: https://phabricator.services.mozilla.com/D76825
Diffstat (limited to 'components/style/servo')
-rw-r--r--components/style/servo/selector_parser.rs6
1 files changed, 0 insertions, 6 deletions
diff --git a/components/style/servo/selector_parser.rs b/components/style/servo/selector_parser.rs
index 7f8ac65089d..d8b84b13280 100644
--- a/components/style/servo/selector_parser.rs
+++ b/components/style/servo/selector_parser.rs
@@ -391,12 +391,6 @@ impl NonTSPseudoClass {
pub fn needs_cache_revalidation(&self) -> bool {
self.state_flag().is_empty()
}
-
- /// Returns true if the evaluation of the pseudo-class depends on the
- /// element's attributes.
- pub fn is_attr_based(&self) -> bool {
- matches!(*self, NonTSPseudoClass::Lang(..))
- }
}
/// The abstract struct we implement the selector parser implementation on top