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

On Thu, Oct 6, 2011 at 5:37 PM, Shishir Agrawal <shishir@google.com> wrote:
> On Thu, Oct 6, 2011 at 5:23 PM, Jonas Sicking <jonas@sicking.cc> wrote:
>>
>> But if a document is hidden, due to it's iframe being display:none,
>> wouldn't we want the code in that document to go into resource-saving
>> mode?
>>
>> Say that a page updates itself every minute any time it's displayed.
>> But only while the page is displayed. When hidden it only updates
>> itself every 30 minutes in order to save CPU and bandwidth. If someone
>> puts such a page in an iframe that is display:none, wouldn't you want
>> the page to only update itself every 30 minutes?
>
> That would depend upon the web page in question. If the purpose of the
> sub-document is to become visible when the user clicks a link, then perhaps
> it should keep refreshing often as long as the user has access to the link.

The same can be argued for a background tab or a minimized window. In
both cases the user has immediate access if the user clicks the tab or
the icon in the desktop toolbar.

> I think the idea of Page Visibility was more to provide a way for webpages
> to know how the visibility state of the embedder (the browser tab). If we
> consider the display attribute, we might also want to consider things like
> whether the sub-document is above the fold etc.

Being above the fold seems about equivalent to having another window
fully cover the top-level browser window. In one the frame gets
visible if the user scrolls, in the other if the user moves the
window.

What do we do if the browser window is covered by another window?

It does seem to me that display:none is different from other ways of
hiding an element. For example it makes screen readers not read the
element, and it makes the element take absolutely no space visually on
the page.

But I do agree that it opens the door for other ways affecting a
document's visibility state. Do you have any specific ones in mind?

/ Jonas

Received on Friday, 7 October 2011 01:12:57 UTC