From bdb84c7539e9e5715d5af6cdc9667b11f0dc252b Mon Sep 17 00:00:00 2001 From: Bobby Holley Date: Fri, 21 Apr 2017 18:05:29 -0700 Subject: [PATCH] Don't skip the style sharing cache if an element is affected by state. All elements end up with AFFECTED_BY_STATE right now, presumably due to the UA sheet, and some non-TS pseudo-classes we've added, which means that we currently never insert anything into the cache. MozReview-Commit-ID: 5IU4qrjeJFy --- components/style/matching.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/style/matching.rs b/components/style/matching.rs index fd92ae881e7..8b01b9305e4 100644 --- a/components/style/matching.rs +++ b/components/style/matching.rs @@ -34,7 +34,7 @@ use stylist::ApplicableDeclarationBlock; fn relations_are_shareable(relations: &StyleRelations) -> bool { use selectors::matching::*; !relations.intersects(AFFECTED_BY_ID_SELECTOR | - AFFECTED_BY_PSEUDO_ELEMENTS | AFFECTED_BY_STATE | + AFFECTED_BY_PSEUDO_ELEMENTS | AFFECTED_BY_STYLE_ATTRIBUTE | AFFECTED_BY_PRESENTATIONAL_HINTS) } @@ -822,7 +822,7 @@ pub trait MatchMethods : TElement { } // If the style is shareable, add it to the LRU cache. - if sharing == StyleSharingBehavior::Allow && relations_are_shareable(&primary_relations) { + if sharing == StyleSharingBehavior::Allow { // If we previously tried to match this element against the cache, // the revalidation match results will already be cached. Otherwise // we'll have None, and compute them later on-demand.