Skip to content

Commit

Permalink
Bug 1875040 - Use GetExtantDocument instead of GetDocument. r=smaug
Browse files Browse the repository at this point in the history
Avoids accidentally creating a document when checking if a document's
presentation can be saved.

Differential Revision: https://phabricator.services.mozilla.com/D198781
  • Loading branch information
farre committed Jan 23, 2024
1 parent cd3ae60 commit b51bf27
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docshell/base/nsDocShell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9436,7 +9436,7 @@ nsresult nsDocShell::InternalLoad(nsDocShellLoadState* aLoadState,
// separate check for SHIP so that we know if there are ongoing requests
// before calling Stop() below.
if (mozilla::SessionHistoryInParent()) {
Document* document = GetDocument();
Document* document = GetExtantDocument();
uint32_t flags = 0;
if (document && !document->CanSavePresentation(nullptr, flags, true)) {
// This forces some flags into the WindowGlobalParent's mBFCacheStatus,
Expand Down

0 comments on commit b51bf27

Please sign in to comment.