Bug 1728605 - Part 2: Rename misleading {Window,Browsing}Context::IsCached, r=smaug
This method actually tracks whether the context is current, so it has been renamed, and the behaviour has been inverted. Depends on D124210 Differential Revision: https://phabricator.services.mozilla.com/D124211
This commit is contained in:
@@ -611,7 +611,7 @@ bool BrowsingContext::IsActive() const {
|
||||
if (explicit_ != ExplicitActiveStatus::None) {
|
||||
return explicit_ == ExplicitActiveStatus::Active;
|
||||
}
|
||||
if (current->IsCached()) {
|
||||
if (mParentWindow && !mParentWindow->IsCurrent()) {
|
||||
return false;
|
||||
}
|
||||
} while ((current = current->GetParent()));
|
||||
@@ -936,12 +936,8 @@ void BrowsingContext::PrepareForProcessChange() {
|
||||
MOZ_ASSERT(!mWindowProxy);
|
||||
}
|
||||
|
||||
bool BrowsingContext::IsCached() const {
|
||||
return mParentWindow && mParentWindow->IsCached();
|
||||
}
|
||||
|
||||
bool BrowsingContext::IsTargetable() const {
|
||||
return !GetClosed() && !mIsDiscarded && !IsCached();
|
||||
return !GetClosed() && AncestorsAreCurrent();
|
||||
}
|
||||
|
||||
bool BrowsingContext::HasOpener() const {
|
||||
@@ -956,7 +952,7 @@ bool BrowsingContext::AncestorsAreCurrent() const {
|
||||
}
|
||||
|
||||
if (WindowContext* wc = bc->GetParentWindowContext()) {
|
||||
if (wc->IsCached() || wc->IsDiscarded()) {
|
||||
if (!wc->IsCurrent() || wc->IsDiscarded()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user