зеркало из https://github.com/mozilla/gecko-dev.git
Backed out 2 changesets (bug 1657757, bug 1658280) for causing build bustages in nsDocShell.cpp CLOSED TREE
Backed out changeset 0f03a74f24a5 (bug 1658280) Backed out changeset 3aaeea6bd201 (bug 1657757)
This commit is contained in:
Родитель
b7c6d9d228
Коммит
9858638fe8
|
@ -4739,32 +4739,12 @@ nsDocShell::SetTitle(const nsAString& aTitle) {
|
|||
}
|
||||
|
||||
// Update SessionHistory with the document's title.
|
||||
if (mLoadType != LOAD_BYPASS_HISTORY && mLoadType != LOAD_ERROR_PAGE) {
|
||||
SetTitleOnHistoryEntry();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsDocShell::SetTitleOnHistoryEntry() {
|
||||
if (mOSHE) {
|
||||
if (mOSHE && mLoadType != LOAD_BYPASS_HISTORY &&
|
||||
mLoadType != LOAD_ERROR_PAGE) {
|
||||
mOSHE->SetTitle(mTitle);
|
||||
}
|
||||
|
||||
if (mActiveEntry) {
|
||||
mActiveEntry->SetTitle(mTitle);
|
||||
if (XRE_IsParentProcess()) {
|
||||
SessionHistoryEntry* entry =
|
||||
SessionHistoryEntry::GetByInfoId(mActiveEntry->Id());
|
||||
if (entry) {
|
||||
entry->SetTitle(mTitle);
|
||||
}
|
||||
} else {
|
||||
mozilla::Unused
|
||||
<< ContentChild::GetSingleton()->SendSessionHistoryEntryTitle(
|
||||
mActiveEntry->Id(), mTitle);
|
||||
}
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsPoint nsDocShell::GetCurScrollPos() {
|
||||
|
@ -8494,18 +8474,11 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
|
|||
// Link our new SHEntry to the old SHEntry's back/forward
|
||||
// cache data, since the two SHEntries correspond to the
|
||||
// same document.
|
||||
if (mLoadingEntry && !mLoadingEntry->mIsLoadFromSessionHistory) {
|
||||
// If we're not doing a history load, scroll restoration
|
||||
// should be inherited from the previous session history entry.
|
||||
SetScrollRestorationIsManualOnHistoryEntry(
|
||||
nullptr, &mLoadingEntry->mInfo, scrollRestorationIsManual);
|
||||
}
|
||||
if (mLSHE) {
|
||||
if (!aLoadState->SHEntry()) {
|
||||
// If we're not doing a history load, scroll restoration
|
||||
// should be inherited from the previous session history entry.
|
||||
SetScrollRestorationIsManualOnHistoryEntry(mLSHE, nullptr,
|
||||
scrollRestorationIsManual);
|
||||
mLSHE->SetScrollRestorationIsManual(scrollRestorationIsManual);
|
||||
}
|
||||
mLSHE->AdoptBFCacheEntry(mOSHE);
|
||||
}
|
||||
|
@ -8541,19 +8514,21 @@ nsresult nsDocShell::HandleSameDocumentNavigation(
|
|||
}
|
||||
}
|
||||
|
||||
/* Set the title for the SH entry for this target url so that
|
||||
* SH menus in go/back/forward buttons won't be empty for this.
|
||||
* Note, this happens on mOSHE (and mActiveEntry in the future) because of
|
||||
* the code above.
|
||||
* XXX HandleSameDocumentNavigation needs to be made work with
|
||||
* session-history-in-parent
|
||||
*/
|
||||
SetTitleOnHistoryEntry();
|
||||
|
||||
/* Restore the original LSHE if we were loading something
|
||||
* while same document navigation was initiated.
|
||||
*/
|
||||
SetHistoryEntryAndUpdateBC(Some<nsISHEntry*>(oldLSHE), Nothing());
|
||||
/* Set the title for the SH entry for this target url. so that
|
||||
* SH menus in go/back/forward buttons won't be empty for this.
|
||||
*/
|
||||
ChildSHistory* shistory = GetSessionHistory();
|
||||
if (shistory) {
|
||||
int32_t index = shistory->Index();
|
||||
nsCOMPtr<nsISHEntry> shEntry;
|
||||
shistory->LegacySHistory()->GetEntryAtIndex(index, getter_AddRefs(shEntry));
|
||||
NS_ENSURE_TRUE(shEntry, NS_ERROR_FAILURE);
|
||||
shEntry->SetTitle(mTitle);
|
||||
}
|
||||
|
||||
/* Set the title for the Global History entry for this anchor url.
|
||||
*/
|
||||
|
@ -10780,35 +10755,13 @@ nsDocShell::GetCurrentScrollRestorationIsManual(bool* aIsManual) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
nsDocShell::SetCurrentScrollRestorationIsManual(bool aIsManual) {
|
||||
SetScrollRestorationIsManualOnHistoryEntry(mOSHE, mActiveEntry.get(),
|
||||
aIsManual);
|
||||
if (mOSHE) {
|
||||
mOSHE->SetScrollRestorationIsManual(aIsManual);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void nsDocShell::SetScrollRestorationIsManualOnHistoryEntry(
|
||||
nsISHEntry* aSHEntry, mozilla::dom::SessionHistoryInfo* aInfo,
|
||||
bool aIsManual) {
|
||||
if (aSHEntry) {
|
||||
aSHEntry->SetScrollRestorationIsManual(aIsManual);
|
||||
}
|
||||
|
||||
if (aInfo) {
|
||||
aInfo->SetScrollRestorationIsManual(aIsManual);
|
||||
if (XRE_IsParentProcess()) {
|
||||
SessionHistoryEntry* entry =
|
||||
SessionHistoryEntry::GetByInfoId(aInfo->Id());
|
||||
if (entry) {
|
||||
entry->SetScrollRestorationIsManual(aIsManual);
|
||||
}
|
||||
} else {
|
||||
mozilla::Unused << ContentChild::GetSingleton()
|
||||
->SendSessionHistoryEntryScrollRestorationIsManual(
|
||||
aInfo->Id(), aIsManual);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool nsDocShell::ShouldAddToSessionHistory(nsIURI* aURI, nsIChannel* aChannel) {
|
||||
// I believe none of the about: urls should go in the history. But then
|
||||
// that could just be me... If the intent is only deny about:blank then we
|
||||
|
|
|
@ -1047,12 +1047,6 @@ class nsDocShell final : public nsDocLoader,
|
|||
// LoadGroup.
|
||||
void SetLoadGroupDefaultLoadFlags(nsLoadFlags aLoadFlags);
|
||||
|
||||
void SetTitleOnHistoryEntry();
|
||||
|
||||
void SetScrollRestorationIsManualOnHistoryEntry(
|
||||
nsISHEntry* aSHEntry, mozilla::dom::SessionHistoryInfo* aInfo,
|
||||
bool aIsManual);
|
||||
|
||||
private: // data members
|
||||
nsID mHistoryID;
|
||||
nsString mTitle;
|
||||
|
|
|
@ -45,12 +45,6 @@ class SessionHistoryInfo {
|
|||
return mScrollRestorationIsManual;
|
||||
}
|
||||
const nsAString& GetTitle() { return mTitle; }
|
||||
void SetTitle(const nsAString& aTitle) { mTitle = aTitle; }
|
||||
|
||||
void SetScrollRestorationIsManual(bool aIsManual) {
|
||||
mScrollRestorationIsManual = aIsManual;
|
||||
}
|
||||
|
||||
nsIURI* GetURI() const { return mURI; }
|
||||
|
||||
bool GetURIWasModified() const { return mURIWasModified; }
|
||||
|
|
|
@ -6962,32 +6962,11 @@ mozilla::ipc::IPCResult ContentParent::RecvSessionHistoryUpdate(
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvSynchronizeLayoutHistoryState(
|
||||
const uint64_t& aSessionHistoryEntryID, nsILayoutHistoryState* aState) {
|
||||
uint64_t aSessionHistoryEntryID, nsILayoutHistoryState* aState) {
|
||||
SessionHistoryEntry::UpdateLayoutHistoryState(aSessionHistoryEntryID, aState);
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvSessionHistoryEntryTitle(
|
||||
const uint64_t& aSessionHistoryEntryID, const nsString& aTitle) {
|
||||
SessionHistoryEntry* entry =
|
||||
SessionHistoryEntry::GetByInfoId(aSessionHistoryEntryID);
|
||||
if (entry) {
|
||||
entry->SetTitle(aTitle);
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
ContentParent::RecvSessionHistoryEntryScrollRestorationIsManual(
|
||||
const uint64_t& aSessionHistoryEntryID, const bool& aIsManual) {
|
||||
SessionHistoryEntry* entry =
|
||||
SessionHistoryEntry::GetByInfoId(aSessionHistoryEntryID);
|
||||
if (entry) {
|
||||
entry->SetScrollRestorationIsManual(aIsManual);
|
||||
}
|
||||
return IPC_OK();
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult ContentParent::RecvCommitWindowContextTransaction(
|
||||
const MaybeDiscarded<WindowContext>& aContext,
|
||||
WindowContext::BaseTransaction&& aTransaction, uint64_t aEpoch) {
|
||||
|
|
|
@ -1338,13 +1338,7 @@ class ContentParent final
|
|||
const int32_t& aLength, const nsID& aChangeID);
|
||||
|
||||
mozilla::ipc::IPCResult RecvSynchronizeLayoutHistoryState(
|
||||
const uint64_t& aSessionHistoryEntryID, nsILayoutHistoryState* aState);
|
||||
|
||||
mozilla::ipc::IPCResult RecvSessionHistoryEntryTitle(
|
||||
const uint64_t& aSessionHistoryEntryID, const nsString& aTitle);
|
||||
|
||||
mozilla::ipc::IPCResult RecvSessionHistoryEntryScrollRestorationIsManual(
|
||||
const uint64_t& aSessionHistoryEntryID, const bool& aIsManual);
|
||||
uint64_t aSessionHistoryEntryID, nsILayoutHistoryState* aState);
|
||||
|
||||
// Notify the ContentChild to enable the input event prioritization when
|
||||
// initializing.
|
||||
|
|
|
@ -925,11 +925,6 @@ parent:
|
|||
async SynchronizeLayoutHistoryState(uint64_t aSessionHistoryEntryID,
|
||||
nsILayoutHistoryState aState);
|
||||
|
||||
async SessionHistoryEntryTitle(uint64_t aSessionHistoryEntryID,
|
||||
nsString aTitle);
|
||||
|
||||
async SessionHistoryEntryScrollRestorationIsManual(uint64_t aSessionHistoryEntryID,
|
||||
bool aIsManual);
|
||||
|
||||
async InitBackground(Endpoint<PBackgroundParent> aEndpoint);
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче