RE: [PageVisibility] What should the visibility api return in display:none iframes?

That was my initial impression also. Further, if we begin including formatting information for sub-documents, why not include element visibility? E.g, my canvas element has been scrolled off page, so I should stop my animation. 

Scoping this API to the visibility of the top level document, as it is now, keeps it simple and still very useful in creating power- and CPU- efficient applications, particularly in the cases where the user choses to hide the page from view by interacting with the browser.

Jatinder

-----Original Message-----
From: Anne van Kesteren [mailto:annevk@opera.com] 
Sent: Friday, October 07, 2011 3:15 AM
To: Arvind Jain; Jonas Sicking
Cc: Jatinder Mann; Boris Zbarsky; public-web-perf@w3.org
Subject: Re: [PageVisibility] What should the visibility api return in display:none iframes?

On Fri, 07 Oct 2011 02:28:18 +0200, Jonas Sicking <jonas@sicking.cc> wrote:
> That means that if a page wants to only do certain actions when 
> displayed, it has to first check it's .hidden state, then walk up the 
> element.ownerDocument.defaultView.frameElement chain and at each 
> element use CSSOM to check if the iframe is hidden (which off the top 
> of my head I don't remember the API for).
>
> This seems severely more complex than simply checking .hidden. Does 
> anyone know of any webpages that we can check to see if they do this?
>
> What is the benefit of this approach?

Are you also going to check for it being positioned off-screen, visibility:hidden, et cetera? It seems somewhat weird to have a display:none special case in this API.


--
Anne van Kesteren
http://annevankesteren.nl/

Received on Friday, 7 October 2011 17:21:33 UTC