Re: [RequestAnimationFrame] requestAnimationFrame use in documents whose containing elements have no CSS box

On Thu, Dec 22, 2011 at 8:30 AM, Boris Zbarsky <> wrote:

> Consider a testcase like this:
>  <iframe style="display: none"
>          src="some-document-using-**requestAnimationFrame">
>  </iframe>
> I believe that right now Gecko will not run the animation frame callbacks
> for that subdocument.  I'm guessing that WebKit will run them, based on
> brief code inspection.  What does IE do?
> The reason Gecko doesn't run them is that they're tied into the general
> "animation" infrastructure, which gets turned off in any situation in which
> styles cannot be computed.  And in documents whose viewport does not have a
> useful size (because the iframe has no CSS box at all), that's the case in
> Gecko.

That sounds like perfectly reasonable behavior.

> The obvious questions are:
> 1)  Does the spec allow this behavior?

Currently, no.

> 2)  If not, should it?

I believe it should.

3)  Should it require it?  (This would take a bit of thinking to define;
> the definition of what Gecko does is above: no request callbacks in a
> document whose containing element has no CSS box; there may be some
> weirdness with svg:foreignObject kids having boxes even if the
> foreignObject is display:none, of course.)

I think it should but I'm not sure how to do so. It would surprise me if
this concept is completely novel in the web platform, does nothing else
need this?  If this is novel, could you propose some spec text?  The most
obvious WebKit implementation would be based on a similar CSS box
implementation construct.

As an aside, I had hoped that the hidden attribute from DocumentVisibility
would define this but that's defined purely in terms of the top-level
browsing context of the document.  It'd be nice if the property we use is
something that authors can directly query.

- James

> -Boris

Received on Tuesday, 3 January 2012 18:36:53 UTC