Bug 1361274. There's no need to update link :visited state when doing querySelectorAll, since querySelectorAll ignores that state anyway. r=smaug
In our current setup, in which links with an href attribute always match either :link or :visited, no matter whether that attribute's value is a valid URI, changes to the attribute always put the element into either the "match nothing" state or the "match :link" state, via calls to Link::ResetLinkState. The only thing FlushPendingLinkUpdates is needed for is (lazily, in case it turns out to not be needed because the element got removed from the DOM anyway) registering a history observer to switch the link state to :visited as needed. This means that selector matching consumers that would never expose :visited state to start with don't need to worry about calling FlushPendingLinkUpdates.
This commit is contained in:
@@ -295,7 +295,6 @@ HTMLContentElement::Match(nsIContent* aContent)
|
||||
|
||||
TreeMatchContext matchingContext(false, nsRuleWalker::eRelevantLinkUnvisited,
|
||||
doc, TreeMatchContext::eNeverMatchVisited);
|
||||
doc->FlushPendingLinkUpdates();
|
||||
matchingContext.SetHasSpecifiedScope();
|
||||
matchingContext.AddScopeElement(host->AsElement());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user