Closed Bug 1779559 Opened 7 months ago Closed 7 months ago

Consider making `document.visibilityState` work in chrome docs (reflect window occlusion)


(Core :: DOM: Core & HTML, task)




104 Branch
Tracking Status
relnote-firefox --- 104+
firefox104 --- fixed


(Reporter: emilio, Assigned: emilio)


(Blocks 2 open bugs, Regressed 1 open bug)


(Keywords: power)


(3 files)

Seems it'd make the code a bit simpler and more consistent.

Just like it manages content, so that we stop chrome animations and such
in hidden or fully-occluded windows too. This already happened on macOS
for minimized windows via PauseCompositor, but this should be better and
more consistent.

This simplifies a bit the tabbrowser/tab switcher code, and makes it
work in all windows.

Pushed by
Make tabbrowser manage chrome BC activeness. r=Gijs

Backed out for causing multiple bc failures

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | browser/components/places/tests/browser/browser_toolbar_other_bookmarks.js | Test timed out -
  • Failure Log 2
  • Failure line 2: TEST-UNEXPECTED-FAIL | browser/base/content/test/gesture/browser_gesture_navigation.js | should be stopping anim -
Flags: needinfo?(emilio)
Pushed by
Disable Windows' window occlusion in some more mochitests. r=sotaro
Flags: needinfo?(emilio)
Keywords: leave-open
Keywords: leave-open
Pushed by
Make tabbrowser manage chrome BC activeness. r=Gijs
Do this in toolkit instead. r=Gijs
Pushed by
Annotate a test on Linux for now.
Blocks: 1780212
Pushed by
Annotate another Linux test for now.
Pushed by
Disable occlusion in another mochitest.

Backed out for causing wpt failures on unload-bubbles.html

Flags: needinfo?(emilio)
Flags: needinfo?(emilio)
Pushed by
Make tabbrowser manage chrome BC activeness. r=Gijs
Do this in toolkit instead. r=Gijs
Blocks: 1578123
Closed: 7 months ago
Resolution: --- → FIXED
Target Milestone: --- → 104 Branch

Thanks for fixing this!

Here is a profile of the tab throbber animation with the patches applied:

(Steps to reproduce: I loaded in a tab (this page keeps the tab loading animation going forever), started the profiler, and then made the window fully occluded (in a way that Mac OS would detect, ie. I resized the window to avoid touching the left/right edges of the screen to avoid bug 1779557).)

What I see in the profile: when the window is fully occluded, the RefreshDriverTick (and CSS animation iteration) markers are throttled in the parent process main thread (the patches work!), but the full activity continues in the Renderer and Compositor threads, ie I can still reproduce bug 1768495.

Blocks: power-usage
Keywords: power
See Also: → 1780207
Regressions: 1782134
Regressions: 1783289

Release Note Request (optional, but appreciated)
[Why is this notable]: Reduces battery usage by throttling animations in our UI inside occluded or minimized windows.
[Affects Firefox for Android]: no
[Suggested wording]: The Firefox UI itself will now be throttled for performance and battery usage when minimized or occluded, in the same way background tabs are.
[Links (documentation, blog post, etc)]: n/a

relnote-firefox: --- → ?
You need to log in before you can comment on or make changes to this bug.