mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
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
This commit is contained in:
parent
c65dea95d7
commit
bdb84c7539
1 changed files with 2 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue