Skip to content

Commit

Permalink
Don't skip the style sharing cache if an element is affected by state.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bholley committed Apr 23, 2017
1 parent c65dea9 commit bdb84c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/style/matching.rs
Expand Up @@ -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)
}
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit bdb84c7

Please sign in to comment.