getZoomPercent - Zoom level needed for Canvas bitmaps

Is there a standard in place to get the current zoom level?

When a user agent zooms the web page, changing the logical pixel ratio, 
Canvas elements may be repainted at a higher resolution,
to maintain crispness.

For example, at a 2x zoom, the pixel width/height are effectively doubled.

So the following would show up at 300x150 pixels, matching the bitmap:
<canvas style="width: 150px; height: 75px;" width="300" height="150">

I've brought this up in a few groups, but I don't know that it's gone 
anywhere.

Some Chrome-related discussion of zoom APIs can be found at the 
following link:
http://code.google.com/p/chromium/issues/detail?id=30583

document.body.style.zoom
chrome.tabs.getZoomPercent

There is a whole lot of quirk between the major browsers, in identifying 
the current
zoom level and available screen pixels. By standardizing an onZoom event 
and zoomRatio getter,
we could both repaint our canvas elements to match the zoom level. Our 
current method for
detecting zoom is fragile and low precision.


-Charles

Received on Monday, 8 November 2010 19:12:50 UTC