W3C home > Mailing lists > Public > public-webapps@w3.org > April to June 2012

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

From: (wrong string) 勤 <gman@google.com>
Date: Tue, 8 May 2012 17:30:48 -0700
Message-ID: <CAKZ+BNocYAbg8Rf+iHemGFaXOw=stRpcn=5mQ3GXLnof=MWrOw@mail.gmail.com>
To: Web Applications Working Group WG <public-webapps@w3.org>
Imagine you want to make a Web Component that draws a graph
Imagine that you'd like the graph to show more data if it's larger and less
if it's smaller. In other words, you don't want it to scale the data.
Imagine you set that component's size to width: 100%; height: 100% to scale
to its container

Question: How does the Web Component know when to repaint its content?

AFAICT the resize event only fires on window. If the point of Web
Components is to allow people to make self contained components it seems
like there might be the need for some way of letting the component know it
needs to repaint.

Resize is just one example.

Imagine a relatively heavy to repaint WebComponent like one that draws an
representation of an audio wave. If that component is hidden behind some
other component it would be nice if it didn't re-draw itself. When it
becomes visible thought needs  to know it should redraw itself.

Does a 'paint' event make sense?
Received on Wednesday, 9 May 2012 00:31:20 UTC

This archive was generated by hypermail 2.3.1 : Friday, 27 October 2017 07:26:40 UTC