mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-24 05:11:16 +00:00
Bug 1760674. r=mak
Differential Revision: https://phabricator.services.mozilla.com/D141958
This commit is contained in:
parent
b37d1f8e80
commit
8885ef4b8d
@ -108,10 +108,6 @@ void BaseHistory::RegisterVisitedCallback(nsIURI* aURI, Link* aLink) {
|
||||
// This will not catch a case where it is registered for two different URIs.
|
||||
MOZ_DIAGNOSTIC_ASSERT(!links->mLinks.Contains(aLink),
|
||||
"Already tracking this Link object!");
|
||||
// FIXME(emilio): We should consider changing this (see the entry.Remove()
|
||||
// call in NotifyVisitedInThisProcess).
|
||||
MOZ_DIAGNOSTIC_ASSERT(links->mStatus != VisitedStatus::Visited,
|
||||
"We don't keep tracking known-visited links");
|
||||
|
||||
links->mLinks.AppendElement(aLink);
|
||||
|
||||
@ -199,15 +195,6 @@ void BaseHistory::NotifyVisitedInThisProcess(nsIURI* aURI,
|
||||
for (Link* link : links.mLinks.BackwardRange()) {
|
||||
link->VisitedQueryFinished(visited);
|
||||
}
|
||||
|
||||
// We never go from visited -> unvisited.
|
||||
//
|
||||
// FIXME(emilio): It seems unfortunate to remove a link to a visited uri and
|
||||
// then re-add it to the document to trigger a new visited query. It shouldn't
|
||||
// if we keep track of mStatus.
|
||||
if (visited) {
|
||||
entry.Remove();
|
||||
}
|
||||
}
|
||||
|
||||
void BaseHistory::SendPendingVisitedResultsToChildProcesses() {
|
||||
|
@ -60,25 +60,17 @@ bool Link::ElementHasHref() const {
|
||||
|
||||
void Link::VisitedQueryFinished(bool aVisited) {
|
||||
MOZ_ASSERT(mRegistered, "Setting the link state of an unregistered Link!");
|
||||
MOZ_ASSERT(mState == State::Unvisited,
|
||||
"Why would we want to know our visited state otherwise?");
|
||||
|
||||
auto newState = aVisited ? State::Visited : State::Unvisited;
|
||||
|
||||
// Set our current state as appropriate.
|
||||
mState = newState;
|
||||
|
||||
// We will be no longer registered if we're visited, as it'd be pointless, we
|
||||
// never transition from visited -> unvisited.
|
||||
if (aVisited) {
|
||||
mRegistered = false;
|
||||
}
|
||||
|
||||
MOZ_ASSERT(LinkState() == NS_EVENT_STATE_VISITED ||
|
||||
LinkState() == NS_EVENT_STATE_UNVISITED,
|
||||
"Unexpected state obtained from LinkState()!");
|
||||
|
||||
// Tell the element to update its visited state
|
||||
// Tell the element to update its visited state.
|
||||
mElement->UpdateState(true);
|
||||
|
||||
if (StaticPrefs::layout_css_always_repaint_on_unvisited()) {
|
||||
|
Loading…
Reference in New Issue
Block a user