Bug 137037

Summary: Adopt Page Visibility 2 optimizations as defined in W3C spec
Product: WebKit Reporter: Jeffrey Gilbert <jeffreytgilbert>
Component: WebKit2Assignee: Nobody <webkit-unassigned>
Status: RESOLVED WONTFIX    
Severity: Enhancement CC: barraclough, cdumez, dbates, simon.fraser, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility2/Overview.html
See Also: https://bugs.webkit.org/show_bug.cgi?id=159475

Description Jeffrey Gilbert 2014-09-23 12:35:23 PDT
My recommendation is to extend the functionality of the current Page Visibility API to allow optimizing content not visible in the active area of the viewport. As defined in the Page Visibility 2 Editor's Draft, this would include iframes separate from the parent document, content hidden by CSS manipulation (display:none, opacity:0, visibility hidden, width/height:0), minimization of the window, backgrounding, screen savers, but could also include browser windows hidden from display, or obscured by other windows (ex: Apple's App Nap or botnets running browser shells of webkit/Trident/Chromium purposely hidden from view). Currently, this relates to how the browser is optimizing content, but this could be amended to simply broadcast if it were out of view, and capable of being passively ignored or actively utilized.

The spec: https://dvcs.w3.org/hg/webperf/raw-file/tip/specs/PageVisibility2/Overview.html

W3C Dialog started here:
http://lists.w3.org/Archives/Public/public-web-perf/2014Jan/0040.html

Dialog reopened here:
http://lists.w3.org/Archives/Public/public-web-perf/2014Sep/0052.html

Relevance:
http://blogs.keynote.com/the_watch/2014/02/filtering-out-web-performance-monitoring-traffic-from-google-analytics.html
Comment 1 Jeffrey Gilbert 2014-09-23 16:46:48 PDT
May also align with the following bug tickets:

Summary:	[GTK] Add support for the hidden page DOM timer throttling
https://bugs.webkit.org/show_bug.cgi?id=99059

Don't fire requestAnimationFrame for scripts in frames that are out of view
https://bugs.webkit.org/show_bug.cgi?id=100257
Comment 2 Gavin Barraclough 2014-09-23 22:17:11 PDT
Sounds great, we should do this.

> minimization of the window, backgrounding, screen savers, but could also include browser windows hidden from display, or obscured by other windows

We should have these mostly covered already, on Mac at least (& iOS, to the extent appropriate!).

> include iframes separate from the parent document, content hidden by CSS manipulation (display:none, opacity:0, visibility hidden, width/height:0),

Don't believe we have any of this yet.
Comment 3 Radar WebKit Bug Importer 2016-08-18 10:43:58 PDT
<rdar://problem/27908125>
Comment 4 Chris Dumez 2016-12-12 14:26:10 PST
(In reply to comment #2)
> Sounds great, we should do this.
> 
> > minimization of the window, backgrounding, screen savers, but could also include browser windows hidden from display, or obscured by other windows
> 
> We should have these mostly covered already, on Mac at least (& iOS, to the
> extent appropriate!).
> 
> > include iframes separate from the parent document, content hidden by CSS manipulation (display:none, opacity:0, visibility hidden, width/height:0),
> 
> Don't believe we have any of this yet.

Looks like this part was reverted in https://github.com/w3c/page-visibility/commit/21540308e91d9fad2d91c4b3121e1ce33a2532b2. The latest specification does not have any mention of this.
Comment 5 Chris Dumez 2016-12-13 09:59:18 PST
Closing this as the frame-level optimizations were reverted from the specification.