Skip to content

Commit fd8e722

Browse files
committed
servo: Merge #17778 - stylo: Don't ignore visited state when deciding to share style contexts (from Manishearth:stylo-visited-fix); r=bz
r=bz https://bugzilla.mozilla.org/show_bug.cgi?id=1381635 Source-Repo: https://github.com/servo/servo Source-Revision: 38e808645292a1e4e9264937b979137b194c2196 UltraBlame original commit: d396287f259511a918635420ecd87fd503df885b
1 parent 9a00d89 commit fd8e722

File tree

2 files changed

+4
-16
lines changed

2 files changed

+4
-16
lines changed

servo/components/style/sharing/checks.rs

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ use Atom;
1010
use bloom::StyleBloom;
1111
use context::{SelectorFlagsMap, SharedStyleContext};
1212
use dom::TElement;
13-
use element_state::*;
1413
use sharing::{StyleSharingCandidate, StyleSharingTarget};
1514
use stylearc::Arc;
1615

@@ -71,20 +70,6 @@ pub fn have_same_class<E>(target: &mut StyleSharingTarget<E>,
7170

7271

7372

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-
86-
87-
8873

8974

9075

servo/components/style/sharing/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,10 @@ impl<E: TElement> StyleSharingCandidateCache<E> {
643643
miss!(UserAndAuthorRules)
644644
}
645645

646-
if !checks::have_same_state_ignoring_visitedness(target.element, candidate) {
646+
647+
648+
649+
if target.element.get_state() != candidate.get_state() {
647650
miss!(State)
648651
}
649652

0 commit comments

Comments
 (0)