mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +01:00
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
This commit is contained in:
parent
4cf9aeeaf7
commit
964716f72a
5 changed files with 68 additions and 113 deletions
|
@ -229,17 +229,6 @@ impl NonTSPseudoClass {
|
|||
NonTSPseudoClass::MozLWThemeDarkText
|
||||
)
|
||||
}
|
||||
|
||||
/// 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::MozTableBorderNonzero |
|
||||
NonTSPseudoClass::MozBrowserFrame |
|
||||
NonTSPseudoClass::Lang(..)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
impl ::selectors::parser::NonTSPseudoClass for NonTSPseudoClass {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue