<div class="gmail_quote">On Thu, Oct 15, 2009 at 12:46 PM, Boris Zbarsky <span dir="ltr"><<a href="mailto:bzbarsky@mit.edu">bzbarsky@mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">On 10/15/09 3:35 PM, Gregg Tavares wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I was wondering if there as been a proposal for either an optional<br>
argument to setInterval that makes it only callback if the window is<br>
visible OR maybe a window.setRenderInterval.<br>
</blockquote>
<br></div>
You might be interested in <a href="http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/527d0cedb9b0df7f/57625c94cdf493bf" target="_blank">http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/527d0cedb9b0df7f/57625c94cdf493bf</a> for some more discussion about approaches to this problem.  In particular, that proposal tries to address overeager animations in visible windows as well.<br>


<br>
Note, by the way, that testing whether a window is "visible" is not cheap; testing whether an element is "visible" is even less cheap....<br></blockquote><div><br></div><div>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.</div>

<div><br></div><div>I agree that some mechanism to know when things aren't visible would be very useful.</div></div>