Re: Adding a paint event to HTMLElement to support Web Components / Shadow DOM

On 5/9/12 1:20 AM, Gregg Tavares (勤) wrote:
> I don't think I understand how requestAnimationFrame would work here.
> Maybe my example was poor. I'm not suggesting a live constantly updating
> audio wave. Instead I'm suggesting a static WebComponent that is heavy
> to render. For example the wave display in an audio editing tool. Let's
> say I had an app that displayed several audio tracks, some of those
> tracks are scrolled off the page. (like this
> http://www.newfreedownloads.com/imgs/17189-w520.jpg) The tracks
> components are set to 100% width so that sizing the window ends up
> re-sizing all the components

Then their resize handlers do requestAnimationFrame(rerender_me, 
this_element).  If the element is visible, rerender_me is called.  If 
not, it's queued up by the browser until the element becomes visible, no?

That's assuming support for the element argument to 
requestAnimationFrame, of course.

-Boris

Received on Wednesday, 9 May 2012 05:55:55 UTC