Re: [whatwg] High-density canvases

In the interest of moving forward with this, I began an experimental
implementation of the renderedPixelWidth/Height propsal (
https://wiki.whatwg.org/wiki/CanvasRenderedPixelSize) in Blink.  I ran into
some issues, which I documented in the "issues" section of the proposal.  I
would like to draw your attentions to them at this point:

1. Hard to determine a rendered size when the canvas is not attached to the
DOM. Perhaps in that case the current intrinsic size should be returned?
2. After a layout change that affects rendered pixel size, there is no
guarantee that the size change event will be handled before the layout
change is propagated to screen, so the content may be temporarily displayed
in an inconsistent state. Note: the same issue exists with existing methods
that may be based on mutation observers or window.onresize, for example.
Though it is not the stated objective of this proposal to solve this
synchronization problem, there may be an opportunity to do so.
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.

Received on Wednesday, 15 April 2015 19:08:14 UTC