Bug 1563996 - Make layout.show_previous_page a static pref. r=bzbarsky
This is a weird pref. First, it is VarCached into two different global variables, one in nsSubDocumentFrame.cpp, and the other in nsView.cpp. Second, the pref is not defined by default. When the VarCache variables are initialized they are therefore set to the default value provided to the `AddBoolVarCache()` call, which in both cases is `true`. This semantics isn't possible with `StaticPrefs`, so the patch defines the pref as true by default. Differential Revision: https://phabricator.services.mozilla.com/D37204
This commit is contained in:
@@ -56,8 +56,6 @@ using namespace mozilla;
|
||||
using namespace mozilla::layers;
|
||||
using mozilla::dom::Document;
|
||||
|
||||
static bool sShowPreviousPage = true;
|
||||
|
||||
static Document* GetDocumentFromView(nsView* aView) {
|
||||
MOZ_ASSERT(aView, "null view");
|
||||
|
||||
@@ -112,15 +110,6 @@ void nsSubDocumentFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
|
||||
// determine if we are a <frame> or <iframe>
|
||||
mIsInline = !aContent->IsHTMLElement(nsGkAtoms::frame);
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
nsAtomicContainerFrame::Init(aContent, aParent, aPrevInFlow);
|
||||
|
||||
// CreateView() creates this frame's view, stored in mOuterView. It needs to
|
||||
@@ -255,7 +244,7 @@ mozilla::PresShell* nsSubDocumentFrame::GetSubdocumentPresShellForPainting(
|
||||
mozilla::PresShell* presShellForNextView = frame->PresShell();
|
||||
if (!presShell || (presShellForNextView &&
|
||||
!presShellForNextView->IsPaintingSuppressed() &&
|
||||
sShowPreviousPage)) {
|
||||
StaticPrefs::layout_show_previous_page())) {
|
||||
subdocView = nextView;
|
||||
subdocRootFrame = frame;
|
||||
presShell = presShellForNextView;
|
||||
|
||||
Reference in New Issue
Block a user