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

On 1/3/12 1:36 PM, James Robinson wrote:
>     2)  If not, should it?
>
> I believe it should.

Excellent.

>     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?

It's somewhat novel, actually, as a cross-browser thing.

At least last I checked, WebKit will compute styles for elements in any 
document, even those without a CSS viewport; I assume it does 
"something" for media queries in such documents.  In that situation 
Gecko will throw an exception when attempting to compute style.

> 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.

Hmm.

So the simplest way to spec this, I think, is to say that 
requestAnimationFrame callbacks are suspended in any document which does 
not have a CSS viewport.  But I think that just pushes the problem off, 
in some ways, since no spec really defines that last bit very much.  One 
can maybe infer that a subdocument whose containing frame/iframe element 
has no CSS box would have no viewport, but I'm not entirely sure about that.

Perhaps the right approach is to spec it that way and figure out what 
spec should be defining existence or nonexistence of document viewports?

> 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.

I don't believe there is an existing such property in the web platform.  :(

-Boris

Received on Wednesday, 4 January 2012 06:25:41 UTC