W3C home > Mailing lists > Public > public-webapps@w3.org > January to March 2010

Re: element.onresize

From: Olli Pettay <Olli.Pettay@helsinki.fi>
Date: Tue, 02 Feb 2010 23:41:35 +0200
Message-ID: <4B689C0F.9080009@helsinki.fi>
To: Gregg Tavares <gman@google.com>
CC: Web Applications Working Group WG <public-webapps@w3.org>
On 2/2/10 11:09 PM, Gregg Tavares wrote:
> I'm not sure if this is the correct place for this but:
>
> Has there been any discussion of adding an element.onresize event?
>
> The issue that has come up is the canvas tag, in 2d or 3d, when the canvas
> changes its displayed size, a webapp might want to respond by changing
> the size of the internal representation of the canvas.
>
> Unfortunately an appt has no way to know when the
> canvas's display size has changed.
>
> The developer can use window.onresize but that only triggers when the window
> itself has changed size. If the canvas element has changed size for some
> other
> reason (another element's css or size were changed for example) no
> window.onresize
> is sent and so their is no easy way to know the display size of the
> canvas changed.
>
> This could be added to just the canvas tag but it seems like it would be
> more
> appropriate to be added to all (visual?) elements.
>
> I can see for example, setting img.src depending on the display size of the
> img element or changing the content of a div depending on its display size.
>
>
DOM Events 3 draft has currently resize event.
The definition of it may still change, since there are
still problems to fix.
http://dev.w3.org/2006/webapi/DOM-Level-3-Events/html/DOM3-Events.html#event-type-resize 



I *believe* currently only IE supports resize, and even it has
some hacks around it.


-Olli
Received on Tuesday, 2 February 2010 21:42:17 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 18:49:36 GMT