diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 9e006823d902..a82ec68236e4 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -5820,16 +5820,8 @@ void PresShell::DoUpdateApproximateFrameVisibility(bool aRemoveOnly) { } bool PresShell::AssumeAllFramesVisible() { - static bool sFrameVisibilityEnabled = true; - static bool sFrameVisibilityPrefCached = false; - - if (!sFrameVisibilityPrefCached) { - Preferences::AddBoolVarCache(&sFrameVisibilityEnabled, - "layout.framevisibility.enabled", true); - sFrameVisibilityPrefCached = true; - } - - if (!sFrameVisibilityEnabled || !mPresContext || !mDocument) { + if (!StaticPrefs::layout_framevisibility_enabled() || !mPresContext || + !mDocument) { return true; } diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml index 6f09de2670a9..eea2978e0b43 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml @@ -6016,6 +6016,12 @@ value: true mirror: always +# Whether frame visibility tracking is enabled globally. +- name: layout.framevisibility.enabled + type: bool + value: true + mirror: always + # The fraction of the scrollport we allow to horizontally scroll by before we # schedule an update of frame visibility. - name: layout.framevisibility.amountscrollbeforeupdatehorizontal diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 65438672e775..1f1f29e3a815 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -918,9 +918,6 @@ pref("nglayout.enable_drag_images", true); pref("nglayout.debug.paint_flashing", false); pref("nglayout.debug.paint_flashing_chrome", false); -// Whether frame visibility tracking is enabled globally. -pref("layout.framevisibility.enabled", true); - pref("layout.framevisibility.numscrollportwidths", 0); pref("layout.framevisibility.numscrollportheights", 1);