зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1741132 - Add a property for whether an entry is in the BFCache (holds a content viewer or a frame loader). r=smaug
Differential Revision: https://phabricator.services.mozilla.com/D131893
This commit is contained in:
Родитель
b55325dab8
Коммит
00ffaf83c0
|
@ -595,6 +595,12 @@ SessionHistoryEntry::SetContentViewer(nsIContentViewer* aContentViewer) {
|
|||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SessionHistoryEntry::GetIsInBFCache(bool* aResult) {
|
||||
*aResult = !!SharedInfo()->mFrameLoader;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
SessionHistoryEntry::GetSticky(bool* aSticky) {
|
||||
*aSticky = SharedInfo()->mSticky;
|
||||
|
|
|
@ -110,6 +110,8 @@ interface nsISHEntry : nsISupports
|
|||
/** Content viewer, for fast restoration of presentation */
|
||||
[infallible] attribute nsIContentViewer contentViewer;
|
||||
|
||||
[infallible] readonly attribute boolean isInBFCache;
|
||||
|
||||
/** Whether the content viewer is marked "sticky" */
|
||||
[infallible] attribute boolean sticky;
|
||||
|
||||
|
|
|
@ -996,6 +996,12 @@ nsSHEntry::GetContentViewer(nsIContentViewer** aResult) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::GetIsInBFCache(bool* aResult) {
|
||||
*aResult = !!GetState()->mContentViewer;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsSHEntry::Clone(nsISHEntry** aResult) {
|
||||
nsCOMPtr<nsISHEntry> entry = new nsSHEntry(*this);
|
||||
|
|
|
@ -972,6 +972,10 @@ static void LogEntry(nsISHEntry* aEntry, int32_t aIndex, int32_t aTotal,
|
|||
MOZ_LOG(gSHLog, LogLevel::Debug,
|
||||
(" %s%s Name = %s\n", prefix.get(), childCount > 0 ? "|" : " ",
|
||||
NS_LossyConvertUTF16toASCII(name).get()));
|
||||
MOZ_LOG(
|
||||
gSHLog, LogLevel::Debug,
|
||||
(" %s%s Is in BFCache = %s\n", prefix.get(), childCount > 0 ? "|" : " ",
|
||||
aEntry->GetIsInBFCache() ? "true" : "false"));
|
||||
|
||||
nsCOMPtr<nsISHEntry> prevChild;
|
||||
for (int32_t i = 0; i < childCount; ++i) {
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
for (let i = 0; i < history.count; i++) {
|
||||
var shEntry = history.getEntryAtIndex(i).
|
||||
QueryInterface(Ci.nsISHEntry);
|
||||
is(!!shEntry.contentViewer, gExpected[i], "content viewer "+i+", test "+gTestCount);
|
||||
is(shEntry.isInBFCache, gExpected[i], `BFCache for shentry[${i}], test ${gTestCount}`);
|
||||
}
|
||||
|
||||
// Make sure none of the SHEntries share bfcache entries with one
|
||||
|
|
Загрузка…
Ссылка в новой задаче