Re: requestAnimationFrame behavior on display:none iframes

On Wed, Feb 13, 2013 at 4:45 PM, Philippe Le Hegaret <plh@w3.org> wrote:

> > Should requestAnimationFrame tick on display:none iframes?
> >
> > A simple test:
> > http://www.jankfree.com/raf/iframes_and_visibility_when_hidden.html
> >
> > FF and Chrome differ:
> > -  FF doesn't tick
> > - Webkit does
> >
> > Not sure what IE does.
> >
> > And, what do we think is "correct"?
>
> Just to make sure we're closing the loop here. Section 5 of the
> processing model [1] indicates that if the context is not visible
> (hidden is true), no callback happens.
> See also the response from James in
>  http://lists.w3.org/Archives/Public/public-web-perf/2012Oct/0033.html
>
>
The definition of 'hidden' there refers to
http://www.w3.org/TR/page-visibility/#sec-document-interface, which defines
'hidden' for a Document as:

"On getting, the
hidden<http://www.w3.org/TR/page-visibility/#dom-document-hidden>
 attribute MUST return true if the
Document<http://www.w3.org/TR/html5/dom.html#document> contained
by the top level browsing
context<http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context>
(root
window in the browser's viewport)
[HTML5]<http://www.w3.org/TR/page-visibility/#HTML5> is
not visible at all. The attribute MUST return false if the
Document<http://www.w3.org/TR/html5/dom.html#document> contained
by the top level browsing
context<http://www.w3.org/TR/html5/browsers.html#top-level-browsing-context>
is
at least partially visible on at least one screen."

So the value for all documents within the same top level browsing context
is the same, i.e., that of the top level browsing context.  It's not
different for different iframes in the same TLBC.


> So, if display:none is on the iframe, I would expect that no callback
> happens.
>

No, that's not correct at all.

- James


>
> It's not clear if we have a proper test for your case however. I'll try
> to make sure we have one during our CR phase.
>
> Philippe
>
> [1]
> http://w3c-test.org/webperf/specs/RequestAnimationFrame/#processingmodel
>
>
>
>

Received on Thursday, 14 February 2013 00:53:11 UTC