Bug 1940688 - Add a pref to make top level pages always active for the purpose of refresh driver throttling and such. r=layout-reviewers,tnikkel
Differential Revision: https://phabricator.services.mozilla.com/D233937
This commit is contained in:
@@ -7364,7 +7364,7 @@ bool Document::ShouldThrottleFrameRequests() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Hidden()) {
|
if (Hidden() && !StaticPrefs::layout_testing_top_level_always_active()) {
|
||||||
// We're not visible (probably in a background tab or the bf cache).
|
// We're not visible (probably in a background tab or the bf cache).
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -11246,6 +11246,12 @@ bool PresShell::ComputeActiveness() const {
|
|||||||
MOZ_LOG(gLog, LogLevel::Debug,
|
MOZ_LOG(gLog, LogLevel::Debug,
|
||||||
(" > BrowsingContext %p active: %d", bc, inActiveTab));
|
(" > BrowsingContext %p active: %d", bc, inActiveTab));
|
||||||
|
|
||||||
|
if (StaticPrefs::layout_testing_top_level_always_active() && bc &&
|
||||||
|
bc->IsTop()) {
|
||||||
|
MOZ_LOG(gLog, LogLevel::Debug, (" > Activeness overridden by pref"));
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
Document* root = nsContentUtils::GetInProcessSubtreeRootDocument(doc);
|
Document* root = nsContentUtils::GetInProcessSubtreeRootDocument(doc);
|
||||||
if (auto* browserChild = BrowserChild::GetFrom(root->GetDocShell())) {
|
if (auto* browserChild = BrowserChild::GetFrom(root->GetDocShell())) {
|
||||||
// We might want to activate a tab even though the browsing-context is not
|
// We might want to activate a tab even though the browsing-context is not
|
||||||
|
|||||||
@@ -10040,6 +10040,15 @@
|
|||||||
value: true
|
value: true
|
||||||
mirror: always
|
mirror: always
|
||||||
|
|
||||||
|
# Treat top level pages as always-active for the purpose of refresh driver
|
||||||
|
# throttling and such.
|
||||||
|
#
|
||||||
|
# Intended for testing automation and so forth.
|
||||||
|
- name: layout.testing.top-level-always-active
|
||||||
|
type: bool
|
||||||
|
value: false
|
||||||
|
mirror: always
|
||||||
|
|
||||||
# Pref to stop overlay scrollbars from fading out, for testing purposes.
|
# Pref to stop overlay scrollbars from fading out, for testing purposes.
|
||||||
- name: layout.testing.overlay-scrollbars.always-visible
|
- name: layout.testing.overlay-scrollbars.always-visible
|
||||||
type: bool
|
type: bool
|
||||||
|
|||||||
Reference in New Issue
Block a user