mirror of
https://github.com/servo/servo.git
synced 2025-08-05 13:40:08 +01:00
Fix dynamic restyling that changes whether our element may generate a pseudo to clear out stale pseudo styles.
Gecko bug 1324618 part 1: https://bugzilla.mozilla.org/show_bug.cgi?id=1324618
This commit is contained in:
parent
4b99a75508
commit
acb27de71c
1 changed files with 8 additions and 12 deletions
|
@ -1202,14 +1202,6 @@ pub trait MatchMethods : TElement {
|
|||
// Compute rule nodes for eagerly-cascaded pseudo-elements.
|
||||
let mut matches_different_pseudos = false;
|
||||
SelectorImpl::each_eagerly_cascaded_pseudo_element(|pseudo| {
|
||||
let bloom_filter = context.thread_local.bloom_filter.filter();
|
||||
|
||||
let mut matching_context =
|
||||
MatchingContext::new_for_visited(MatchingMode::ForStatelessPseudoElement,
|
||||
Some(bloom_filter),
|
||||
visited_handling,
|
||||
context.shared.quirks_mode);
|
||||
|
||||
// For pseudo-elements, we only try to match visited rules if there
|
||||
// are also unvisited rules. (This matches Gecko's behavior.)
|
||||
if visited_handling == VisitedHandlingMode::RelevantLinkVisited &&
|
||||
|
@ -1217,11 +1209,15 @@ pub trait MatchMethods : TElement {
|
|||
return
|
||||
}
|
||||
|
||||
if !self.may_generate_pseudo(&pseudo, data.styles.primary()) {
|
||||
return;
|
||||
}
|
||||
if self.may_generate_pseudo(&pseudo, data.styles.primary()) {
|
||||
let bloom_filter = context.thread_local.bloom_filter.filter();
|
||||
|
||||
let mut matching_context =
|
||||
MatchingContext::new_for_visited(MatchingMode::ForStatelessPseudoElement,
|
||||
Some(bloom_filter),
|
||||
visited_handling,
|
||||
context.shared.quirks_mode);
|
||||
|
||||
{
|
||||
let map = &mut context.thread_local.selector_flags;
|
||||
let mut set_selector_flags = |element: &Self, flags: ElementSelectorFlags| {
|
||||
self.apply_selector_flags(map, element, flags);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue