New issue
Advanced search Search tips

Issue 725750 link

Starred by 5 users

Issue metadata

Status: WontFix
Owner:
Closed: Sep 2017
Cc:
EstimatedDays: ----
NextAction: ----
OS: iOS
Pri: 2
Type: Compat



Sign in to add a comment

Extend semantics of Page Visibility API to reflect webview and app status

Project Member Reported by rhenders@google.com, May 24 2017

Issue description

Steps to reproduce the problem:
1. open an app with a webview
2. scroll the webview offscreen
3. verify that document.visibilityState = visible

What is the expected behavior?
If the app is not visible or the web view has no pixels visible then document.visibilityState should be 'hidden'.

What went wrong?
Documents do not return consistent results for Page Visibility API when run in a webview.  We propose the following behavior:

* When the webview has at least one pixel visible and the app is visible, then document.visibilityState = “visible”

* When the app is not visible or the webview has no pixels visible, then document.visibilityState = “hidden”

Did this work before? No 

Does this work in other browsers? N/A

Chrome version: 58.0.3029.110  Channel: stable
OS Version: 
Flash Version:
 

Comment 1 by jochen@chromium.org, May 25 2017

Cc: igrigo...@chromium.org pinkerton@chromium.org rbyers@chromium.org
Components: -Blink>JavaScript Blink
not sure who owns page visibility on iOS?
Cc: ajuma@chromium.org danyao@chromium.org
Labels: Needs-Feedback
+danyao, ajuma who can assess priority for fixing in WebKit. 

Does this work in Safari? I don't see why "N/A" is the appropriate answer to that question. Please check and report back here, thanks!

Can you provide a specific url or reduced test case? "an app with a webview" is not enough information to be able to diagnose the problem. 
Components: -Blink Mobile>WebView>Glue

Comment 4 by danyao@chromium.org, May 25 2017

Labels: -Type-Bug Type-Compat
Owner: danyao@chromium.org
Status: Assigned (was: Unconfirmed)
Project Member

Comment 6 by sheriffbot@chromium.org, Jul 14 2017

Labels: Hotlist-Google

Comment 7 by danyao@chromium.org, Sep 28 2017

Status: WontFix (was: Assigned)
I'm not very clear on what you mean by "scroll the webview offscreen" because the entire document is the web view.

If you mean that a document is loaded in in an iframe, and when that iframe is scrolled off screen, that document.visibilityState evaluated inside the iframe should return "hidden", then the Page Visibility API is not designed for this purpose. A document is considered hidden if any of the following is true:
- user navigates away from it
- user switches to another tab in the same window
- the window is minimized
- the window loses focus and is completely obstructed by another window

And the visibility state of an iframe is the same as its parent document. See spec here: https://www.w3.org/TR/page-visibility/#sec-processing-model, or the more user-friendly explainer on MDN: https://developer.mozilla.org/en-US/docs/Web/API/Page_Visibility_API

Bling's behavior matches that of Safari for Page Visibility API.

Intersection Observer API is closer to the behavior you're looking for. See spec here: https://w3c.github.io/IntersectionObserver/ and the MDN explainer here: https://developer.mozilla.org/en-US/docs/Web/API/Intersection_Observer_API

I'll close this bug for now. Please reopen if I misunderstood your request.

Sign in to add a comment