Re: requestAnimationFrame behavior on display:none iframes

I sort of get both sides of this debate.

Here's a comment: by keeping this defined strictly as jamesr advocates, we
avoid other kinds of visibility complications. Does an iframe's that is
offscreen tick? What if the iframe has a reflection that brings the
reflection on screen? What if the iframe is animating? What if the iframe
is below the fold, but the browser predictively renders below the fold?
There be dragons here, methinks.

My personal leaning is to keep rAF as defined super narrow, and put a todo
for the future to discuss element-level rAF. It seems inevitable that we'll
need it, but its gonna be rough to spec.


On Wed, Apr 10, 2013 at 5:45 PM, Boris Zbarsky <bzbarsky@mit.edu> wrote:

> On 4/10/13 6:32 PM, James Robinson wrote:
>
>> 1.) Gmail loads up a large portion of its script in an iframe styled to
>> be 0x0.  While this iframe is not display:none, it's hidden for any
>> practical definition of hidden.
>>
>
> That's not quite true.
>
> For example, it has a well-defined CSS viewport and hence can do media
> queries and selector matching and other CSS things, unlike a display:none
> iframe...
>
>
>  If animations on hidden iframes did not tick, script that ran inside this
>> iframe would not be able to animate parts of the rest of gmail UI.  I
>> think this behavior would be broken.
>>
>
> You could make the same argument about scripts in one tab that try to
> script another one that they opened, no?
>
>
>  The common problem here is that the visibility of the document
>> associated with the global context that requestAnimationFrame is picked
>> up from is a poor proxy for the visibility of the thing the author is
>> actually trying to animate.
>>
>
> But that's not iframe-specific.
>
>
>  context and document a bit more explicit, but it's possible that
>> wouldn't have helped.
>>
>
> I doubt it would have changed how authors think about it.
>
> In any case, I doubt that at this point we're going to agree on this
> issue...
>
> -Boris
>
>

Received on Thursday, 11 April 2013 02:35:06 UTC