Merge m-c to inbound, a=merge
MozReview-Commit-ID: IsbKCdZU2Ui
This commit is contained in:
@@ -1388,8 +1388,16 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||
}
|
||||
|
||||
// Make some decisions on the child frame's loadType based on the
|
||||
// parent's loadType.
|
||||
if (!mCurrentURI) {
|
||||
// parent's loadType, if the subframe hasn't loaded anything into it.
|
||||
//
|
||||
// In some cases privileged scripts may try to get the DOMWindow
|
||||
// reference of this docshell before the loading starts, causing the
|
||||
// initial about:blank content viewer being created and mCurrentURI being
|
||||
// set. To handle this case we check if mCurrentURI is about:blank and
|
||||
// currentSHEntry is null.
|
||||
nsCOMPtr<nsISHEntry> currentChildEntry;
|
||||
GetCurrentSHEntry(getter_AddRefs(currentChildEntry), &oshe);
|
||||
if (!mCurrentURI || (NS_IsAboutBlank(mCurrentURI) && !currentChildEntry)) {
|
||||
// This is a newly created frame. Check for exception cases first.
|
||||
// By default the subframe will inherit the parent's loadType.
|
||||
if (shEntry && (parentLoadType == LOAD_NORMAL ||
|
||||
@@ -1436,12 +1444,16 @@ nsDocShell::LoadURI(nsIURI* aURI,
|
||||
loadType = parentLoadType;
|
||||
}
|
||||
} else {
|
||||
// This is a pre-existing subframe. If the load was not originally
|
||||
// initiated by session history, (if (!shEntry) condition succeeded) and
|
||||
// mCurrentURI is not null, it is possible that a parent's onLoadHandler
|
||||
// or even self's onLoadHandler is loading a new page in this child.
|
||||
// Check parent's and self's busy flag and if it is set, we don't want
|
||||
// this onLoadHandler load to get in to session history.
|
||||
// This is a pre-existing subframe. If
|
||||
// 1. The load of this frame was not originally initiated by session
|
||||
// history directly (i.e. (!shEntry) condition succeeded, but it can
|
||||
// still be a history load on parent which causes this frame being
|
||||
// loaded), and
|
||||
// 2. mCurrentURI is not null, nor the initial about:blank,
|
||||
// it is possible that a parent's onLoadHandler or even self's
|
||||
// onLoadHandler is loading a new page in this child. Check parent's and
|
||||
// self's busy flag and if it is set, we don't want this onLoadHandler
|
||||
// load to get in to session history.
|
||||
uint32_t parentBusy = BUSY_FLAGS_NONE;
|
||||
uint32_t selfBusy = BUSY_FLAGS_NONE;
|
||||
parentDS->GetBusyFlags(&parentBusy);
|
||||
|
||||
Reference in New Issue
Block a user