Bug 1323606. Implement the pref layout.show_previous_page for e10s. r=gw280 r=mats

The existing implementation only works for non-remote subdocuments.

This essentially makes the changes from bug 1157941 conditional on this pref.
This commit is contained in:
Timothy Nikkel 2016-12-19 17:34:00 -06:00
parent 4fe7340dc2
commit f98faf04e3
2 changed files with 11 additions and 1 deletions

View File

@ -113,6 +113,8 @@ nsSubDocumentFrame::Init(nsIContent* aContent,
static bool addedShowPreviousPage = false;
if (!addedShowPreviousPage) {
// If layout.show_previous_page is true then during loading of a new page we
// will draw the previous page if the new page has painting suppressed.
Preferences::AddBoolVarCache(&sShowPreviousPage, "layout.show_previous_page", true);
addedShowPreviousPage = true;
}

View File

@ -23,6 +23,8 @@
using namespace mozilla;
static bool sShowPreviousPage = true;
nsView::nsView(nsViewManager* aViewManager, nsViewVisibility aVisibility)
{
MOZ_COUNT_CTOR(nsView);
@ -36,6 +38,12 @@ nsView::nsView(nsViewManager* aViewManager, nsViewVisibility aVisibility)
mViewManager = aViewManager;
mDirtyRegion = nullptr;
mWidgetIsTopLevel = false;
static bool sShowPreviousPageInitialized = false;
if (!sShowPreviousPageInitialized) {
Preferences::AddBoolVarCache(&sShowPreviousPage, "layout.show_previous_page", true);
sShowPreviousPageInitialized = true;
}
}
void nsView::DropMouseGrabbing()
@ -1123,5 +1131,5 @@ nsView::HandleEvent(WidgetGUIEvent* aEvent,
bool
nsView::IsPrimaryFramePaintSuppressed()
{
return mFrame ? mFrame->PresContext()->PresShell()->IsPaintingSuppressed() : false;
return sShowPreviousPage && mFrame && mFrame->PresContext()->PresShell()->IsPaintingSuppressed();
}