[whatwg] window.setInterval if visible.

Jeremy Orlow jorlow at chromium.org
Thu Oct 15 13:14:54 PDT 2009


On Thu, Oct 15, 2009 at 12:46 PM, Boris Zbarsky <bzbarsky at mit.edu> wrote:

> On 10/15/09 3:35 PM, Gregg Tavares wrote:
>
>> I was wondering if there as been a proposal for either an optional
>> argument to setInterval that makes it only callback if the window is
>> visible OR maybe a window.setRenderInterval.
>>
>
> You might be interested in
> http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/527d0cedb9b0df7f/57625c94cdf493bffor some more discussion about approaches to this problem.  In particular,
> that proposal tries to address overeager animations in visible windows as
> well.
>
> Note, by the way, that testing whether a window is "visible" is not cheap;
> testing whether an element is "visible" is even less cheap....
>

I'd imagine that UAs could use an overly conservative metric of when things
are visible to make things cheaper if/when this is a concern.  All that
really matters is that the UA never say it isn't visible when any part of
the window is visible.

I agree that some mechanism to know when things aren't visible would be very
useful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20091015/984c7c2e/attachment-0002.htm>


More information about the whatwg mailing list