should throttle timers in occluded windows |
|||||
Issue descriptionTest 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.
,
Aug 25 2016
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.
,
Aug 26 2016
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.
,
Aug 26 2016
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.
,
Aug 26 2016
,
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.
,
Mar 17 2017
Hmmm...I can't reproduce this anymore. Not sure what changed, but seems like it works.
,
Mar 17 2017
Which platform were you testing with? There might still be issues on some platforms. |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by esprehn@chromium.org
, Aug 25 2016