Re: [whatwg] High-density canvases

> On 16 Apr 2015, at 6:42 am, Elliott Sprehn <esprehn@chromium.org> wrote:
> 
> 3. Accessing rendered pixel size is layout-inducing. To avoid layout
> thrashing, we should consider making this an asynchronous getter (e.g.
> asyncGetBoundignClientRect). This would also prevent renderedsizechanged
> events from firing from within the evaluation of the renderedPixelWidth/Height
> attributes, which is weird.
> 
> renderedsizechanged feels like it's related to the general per element resize event problem. It'd be unfortunate to add an event to the browser specifically for canvas instead of solving the general problem. In that case authors will start resorting to hacks where they insert canvases into the page to listen for resizes (we've seen this with other events like overflowchanged).
> 
> Perhaps we should add per element resize events and spec that they fire after the layout, but before the paint, during normal frame creation. That does mean you can cause an infinite loop if your resize handler keeps mutating the page, but there's so many other ways to cause that already.

+1

Dean

Received on Wednesday, 15 April 2015 20:47:14 UTC