W3C home > Mailing lists > Public > public-web-perf@w3.org > February 2013

Re: requestAnimationFrame behavior on display:none iframes

From: James Robinson <jamesr@google.com>
Date: Wed, 13 Feb 2013 16:52:44 -0800
Message-ID: <CAD73mdL4WCYbFv7AYyghgzDY=CmYWuhdCJJQ2-DVgmzao6gxyg@mail.gmail.com>
To: Philippe Le Hegaret <plh@w3.org>
Cc: Nat Duca <nduca@chromium.org>, public-web-perf <public-web-perf@w3.org>
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 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Thursday, 14 February 2013 00:53:12 GMT