File tree 2 files changed +4
-16
lines changed
servo/components/style/sharing
2 files changed +4
-16
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ use Atom;
10
10
use bloom:: StyleBloom ;
11
11
use context:: { SelectorFlagsMap , SharedStyleContext } ;
12
12
use dom:: TElement ;
13
- use element_state:: * ;
14
13
use sharing:: { StyleSharingCandidate , StyleSharingTarget } ;
15
14
use stylearc:: Arc ;
16
15
@@ -68,20 +67,6 @@ pub fn have_same_class<E>(target: &mut StyleSharingTarget<E>,
68
67
target. class_list ( ) == candidate. class_list ( )
69
68
}
70
69
71
- /// Compare element and candidate state, but ignore visitedness. Styles don't
72
- /// actually changed based on visitedness (since both possibilities are computed
73
- /// up front), so it's safe to share styles if visitedness differs.
74
- pub fn have_same_state_ignoring_visitedness < E > ( element : E ,
75
- candidate : & StyleSharingCandidate < E > )
76
- -> bool
77
- where E : TElement ,
78
- {
79
- let state_mask = !IN_VISITED_OR_UNVISITED_STATE ;
80
- let state = element. get_state ( ) & state_mask;
81
- let candidate_state = candidate. element . get_state ( ) & state_mask;
82
- state == candidate_state
83
- }
84
-
85
70
/// Whether a given element and a candidate match the same set of "revalidation"
86
71
/// selectors.
87
72
///
Original file line number Diff line number Diff line change @@ -643,7 +643,10 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
643
643
miss ! ( UserAndAuthorRules )
644
644
}
645
645
646
- if !checks:: have_same_state_ignoring_visitedness ( target. element , candidate) {
646
+ // We do not ignore visited state here, because Gecko
647
+ // needs to store extra bits on visited style contexts,
648
+ // so these contexts cannot be shared
649
+ if target. element . get_state ( ) != candidate. get_state ( ) {
647
650
miss ! ( State )
648
651
}
649
652
You can’t perform that action at this time.
0 commit comments