RE: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Ennals, Robert
[hoping that quoting works better this time] On Oct 20, 2009, at 7:41 PM, Maciej Stachowiak wrote: > On Oct 20, 2009, at 7:13 PM, Ennals, Robert wrote: [snip] > > I'd even be tempted to risk breaking existing applications a little bit and > > make the > > *default* behavior for HTML5 pages be tha

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Brian Kardell
So.. I wound up speaking to Robert offline and in our discussion his comments became much clearer to me and I think that it's at least worth documenting in case anyone else misunderstands as I did (even historically via the archive). There are really a few proposals here which are sort of only tan

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Brian Kardell
I like window.hasAttention if you can even vaguely define what it means... It's pointless to make it so vague that useful things will work differently in different browsers by accident rather than by design (for example, it might be ok for mobile devices to work differently by design, but it would

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Brian Kardell
Robert; Jonas Sicking; rob...@ocallahan.org; public- >> weba...@w3.org >> Subject: Re: solving the CPU usage issue for non-visible pages >> >> So... in describing this feature: >> >> Is it really the visibility of the page that is being queried - or the >>

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Brian Kardell
So... in describing this feature: Is it really the visibility of the page that is being queried - or the some kind of state of a window? Maybe it's a silly bit of semantics, but it seems clearer to me that most of the things discussed here are about a whole window/tab being "minimized" (either to

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Brian Kardell
I suppose I should not have used that phrasing... It wasn't really accurate and it obscures my point... My point was that I actually wanted it to run in the background... So - does time stop, or just rendering? I think that you have to be very clear. On Tue, Oct 20, 2009 at 8:43 PM, Robert O'C

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Thomas Broyer
On Wed, Oct 21, 2009 at 5:16 AM, Robert O'Callahan wrote: > > There are lots of reasons why the browser might deduce that the user is not > paying attention to a document, e.g. > -- the browser window containing the document is minimized > -- the tab containing the document is hidden > -- the docum

Re: solving the CPU usage issue for non-visible pages

2009-10-21 Thread Jonas Sicking
On Tue, Oct 20, 2009 at 7:13 PM, Ennals, Robert wrote: >> On Tuesday, October 20, 2009 at 5:37 PM, Jonas Sicking >> wrote: >> On Tue, Oct 20, 2009 at 4:44 PM, Robert O'Callahan >> wrote: >> > On Wed, Oct 21, 2009 at 11:59 AM, Ennals, Robert >> >> > wrote: >> >> >> >> Should we also consider th

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Robert O'Callahan
On Wed, Oct 21, 2009 at 4:34 PM, Brian Kardell wrote: > For example, I recently the Image Evolution demo from > http://www.canvasdemos.com/2009/07/15/image-evolution/ as a kind of a > performance test and let it run for three days - during which it was > not "visible" 99.999% of the time. Should

RE: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Ennals, Robert
Kardell [mailto:bkard...@gmail.com] > Sent: Tuesday, October 20, 2009 8:12 PM > To: Ennals, Robert > Cc: Maciej Stachowiak; Jonas Sicking; rob...@ocallahan.org; public- > weba...@w3.org > Subject: Re: solving the CPU usage issue for non-visible pages > > Right... Not to beat the poi

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Robert O'Callahan
On Wed, Oct 21, 2009 at 3:57 PM, Brian Kardell wrote: > Is it really the visibility of the page that is being queried - or the > some kind of state of a window? Maybe it's a silly bit of semantics, > but it seems clearer to me that most of the things discussed here are > about a whole window/tab

RE: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Ennals, Robert
PM > To: Maciej Stachowiak > Cc: Ennals, Robert; Jonas Sicking; rob...@ocallahan.org; public- > weba...@w3.org > Subject: Re: solving the CPU usage issue for non-visible pages > > So... in describing this feature: > > Is it really the visibility of the page that is being q

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Robert O'Callahan
On Wed, Oct 21, 2009 at 3:41 PM, Maciej Stachowiak wrote: > On Oct 20, 2009, at 7:13 PM, Ennals, Robert wrote: > > > One thing I like about the "requestAnimationFrame" approach is that it > makes it easy to do the right thing. If the simplest approach burns CPU > cycles, and programmers have to t

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Maciej Stachowiak
On Oct 20, 2009, at 7:13 PM, Ennals, Robert wrote: One thing I like about the "requestAnimationFrame" approach is that it makes it easy to do the right thing. If the simplest approach burns CPU cycles, and programmers have to think a bit harder to avoid doing this, then I suspect the lik

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Maciej Stachowiak
On Oct 20, 2009, at 5:36 PM, Jonas Sicking wrote: On Tue, Oct 20, 2009 at 4:44 PM, Robert O'Callahan > wrote: On Wed, Oct 21, 2009 at 11:59 AM, Ennals, Robert > wrote: Should we also consider the case where a web site wants to keep its interface up to date with some server state and is using

RE: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Ennals, Robert
> On Tuesday, October 20, 2009 at 5:37 PM, Jonas Sicking > wrote: > On Tue, Oct 20, 2009 at 4:44 PM, Robert O'Callahan > wrote: > > On Wed, Oct 21, 2009 at 11:59 AM, Ennals, Robert > > > wrote: > >> > >> Should we also consider the case where a web site wants to keep its > >> interface up to da

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Jonas Sicking
On Tue, Oct 20, 2009 at 4:44 PM, Robert O'Callahan wrote: > On Wed, Oct 21, 2009 at 11:59 AM, Ennals, Robert > wrote: >> >> Should we also consider the case where a web site wants to keep its >> interface up to date with some server state and is using up CPU time and >> network resource to do so?

Re: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Robert O'Callahan
On Wed, Oct 21, 2009 at 11:59 AM, Ennals, Robert wrote: > Should we also consider the case where a web site wants to keep its > interface up to date with some server state and is using up CPU time and > network resource to do so? > You could abuse my proposal to do this, by periodically (as frequ

RE: solving the CPU usage issue for non-visible pages

2009-10-20 Thread Ennals, Robert
-webapps-requ...@w3.org [mailto:public-webapps-requ...@w3.org] On Behalf Of Robert O'Callahan Sent: Monday, October 19, 2009 2:52 PM To: public-webapps@w3.org Subject: Re: solving the CPU usage issue for non-visible pages I have a proposal for solving this here: http://groups.google.com/

Re: solving the CPU usage issue for non-visible pages

2009-10-19 Thread Robert O'Callahan
I have a proposal for solving this here: http://groups.google.com/group/mozilla.dev.platform/browse_thread/thread/527d0cedb9b0df7f/57625c94cdf493bf The gist is very simple: 1) window.requestAnimationFrame(): Signals that an animation is in progress, and requests that the browser schedule a repaint

Re: solving the CPU usage issue for non-visible pages

2009-10-19 Thread Jeremy Orlow
FYI, the original WhatWG thread: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2009-October/thread.html#23625 On Mon, Oct 19, 2009 at 1:51 PM, Gregg Tavares wrote: > I posted something about this in the whatwg list and was told to bring it > here. > > Currently, AFAIK, the only way to do an