New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 641045 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Mar 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

should throttle timers in occluded windows

Project Member Reported by ojan@chromium.org, Aug 25 2016

Issue description

Test case: http://jsbin.com/fageqixiku/edit?html,console

When you make that page a background tab, we fire visibilitychange, change visibilityState to hidden and throttle timers.

When you fully occlude the window (i.e. put another window on top of it), we fire visibilitychange, change visibilityState to hidden, but don't throttle timers.

I tested this on Chrome 54.0.2830.0 on Mac 10.11.6.

This seems like some low hanging fruit to save some battery on Mac. From a web platform perspective, it makes sense to treat fully occluded windows the same as background tabs IMO.

Do non-Mac OSes give occlusion detection as well? CCing jschuh to answer this for Windows.
 
I'm pretty sure CrOS does, but I don't know about Windows.

Comment 2 by jsc...@chromium.org, Aug 25 2016

Cc: -jsc...@chromium.org robliao@chromium.org bsep@chromium.org
We're using Aura for the Window management on both, so I would think the logic would be the same between Chrome OS and Windows. But, hopefully robliao@ or bsep@ can give you an answer, or point you to someone who can.

I'm currently not aware of any occlusion detection with respect to timers. A loose survey with @erikchen also reveals that it may have attempted to do this on Mac, but there were some issues with respect to assumptions made by webpages that depended on these timers.

Do we have cases where the foreground window is occluded by the background window? It seems that what we actually want might be that we want to throttle timers when the window is no longer foreground.

Status: Available (was: Untriaged)
You're suggesting we should treat occluded tabs same as background tabs? Seems reasonable to me.

It's weird that this doesn't already work given those other events already fire when the window is occluded.
Cc: altimin@chromium.org

Comment 6 by ojan@chromium.org, Mar 13 2017

Just stumbled across this again.

Re comment 4: Yes, I'm suggesting that occluded tabs should behave the same as background tabs. The occlusion detection is already there since we fire visibilitychange-->hidden. It should be impossible to fire visibilitychange-->hidden and not act like a background tab.

This is likely trivial to fix once someone plumbs through where the logic error is.

Comment 7 by ojan@chromium.org, Mar 17 2017

Status: WontFix (was: Available)
Hmmm...I can't reproduce this anymore. Not sure what changed, but seems like it works.
Which platform were you testing with? There might still be issues on some platforms.

Sign in to add a comment