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

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.

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.


>
> / Jonas
>
> On Thu, Oct 6, 2011 at 4:24 PM, Jatinder Mann <jmann@microsoft.com> wrote:
> > I think so. This behavior makes it clear that the iframe's visibility is
> tied with the top level document. This is the current behavior in both IE10
> and Chrome.
> >
> > Jatinder
> >
> > -----Original Message-----
> > From: Boris Zbarsky [mailto:bzbarsky@MIT.EDU]
> > Sent: Wednesday, October 05, 2011 8:28 PM
> > To: Jatinder Mann
> > Cc: public-web-perf@w3.org
> > Subject: Re: [PageVisibility] What should the visibility api return in
> display:none iframes?
> >
> > On 10/5/11 7:01 PM, Jatinder Mann wrote:
> >> We define the visibility as that of the top level browsing context; all
> connected documents, like iframes, must return the same value.
> >
> > Yes, I'm aware this is what the spec says right now.  What I'm asking is
> > whether this is _desirable_.
> >
> > -Boris
> >
> >
> >
>
>

Received on Friday, 7 October 2011 11:57:28 UTC