Bug 1703692 - Use ChildOffset to build the offset path for flushes, r=nika

We can't rely on the Children list since it may have been cleared on shutdown.
Since we don't clear parent edges, walking the parent chain and using
mChildOffset works.

Differential Revision: https://phabricator.services.mozilla.com/D118384
This commit is contained in:
Kashav Madan
2021-06-26 05:49:12 +00:00
parent d3a7f8a79a
commit bc9322271d
4 changed files with 26 additions and 46 deletions

View File

@@ -3266,6 +3266,17 @@ void BrowsingContext::AddDeprioritizedLoadRunner(nsIRunnable* aRunner) {
EventQueuePriority::Idle);
}
bool BrowsingContext::GetOffsetPath(nsTArray<uint32_t>& aPath) const {
for (const BrowsingContext* current = this; current && current->GetParent();
current = current->GetParent()) {
if (current->CreatedDynamically()) {
return false;
}
aPath.AppendElement(current->ChildOffset());
}
return true;
}
void BrowsingContext::GetHistoryID(JSContext* aCx,
JS::MutableHandle<JS::Value> aVal,
ErrorResult& aError) {