mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01:00
Separate revalidation checking from attribute sensitivity checking.
The current code is busted because: * It unconditionally flags for revalidation if the sensitivities are not yet sensitive to attributes. * It uses is_attr_selector, despite the fact that ID and Class are both handled by the style sharing cache and should not trigger revalidation. MozReview-Commit-ID: C7d8QrdKcFm
This commit is contained in:
parent
ab3f5b0d9f
commit
dd4575c23a
1 changed files with 7 additions and 2 deletions
|
@ -420,11 +420,17 @@ fn is_attr_selector(sel: &Component<SelectorImpl>) -> bool {
|
|||
/// Whether a selector containing this simple selector needs to be explicitly
|
||||
/// matched against both the style sharing cache entry and the candidate.
|
||||
///
|
||||
///
|
||||
/// We use this for selectors that can have different matching behavior between
|
||||
/// siblings that are otherwise identical as far as the cache is concerned.
|
||||
fn needs_cache_revalidation(sel: &Component<SelectorImpl>) -> bool {
|
||||
match *sel {
|
||||
Component::AttrExists(_) |
|
||||
Component::AttrEqual(_, _, _) |
|
||||
Component::AttrIncludes(_, _) |
|
||||
Component::AttrDashMatch(_, _) |
|
||||
Component::AttrPrefixMatch(_, _) |
|
||||
Component::AttrSubstringMatch(_, _) |
|
||||
Component::AttrSuffixMatch(_, _) |
|
||||
Component::Empty |
|
||||
Component::FirstChild |
|
||||
Component::LastChild |
|
||||
|
@ -529,7 +535,6 @@ impl SelectorVisitor for SensitivitiesVisitor {
|
|||
|
||||
if !self.sensitivities.attrs {
|
||||
self.sensitivities.attrs = is_attr_selector(s);
|
||||
self.needs_revalidation = true;
|
||||
}
|
||||
|
||||
if !self.needs_revalidation {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue