[webkit-dev] Canvas backing resolution

David Hyatt hyatt at apple.com
Wed Apr 6 12:32:57 PDT 2011

He wants a way to detect Desktop zoom (which is done two different ways in WebKit).  It's difficult to figure out how to expose these, since Desktop zoom is ultimately just the CSS zoom property, which can be applied to any element (so folding it into a global makes little sense).  The other kind of Desktop zoom that involves a fixed scale factor applies a transform.  Again, transforms can be applied to descendant elements as well, so relying solely on what happened to be specified at the document level makes little sense.

I'm not really sure how to easily solve this problem.  I suppose we could just mix in document-level zoom and transform state into devicePixelRatio, but that feels inelegant to me given that individual child elements can change the zoom and transform.  It wouldn't necessarily be accurate.  I also don't like the idea of having to re-resolve style just because the zoom level changed.  That would just slow things down.

(hyatt at apple.com)

On Apr 6, 2011, at 9:17 AM, Darin Adler wrote:

> On Apr 5, 2011, at 9:52 PM, Charles Pritchard wrote:
>> Long-story-short, can we please expose some of the CSS pixel scaling, either through window.devicePixelRatio
> I typed javascript:alert(devicePixelRatio) in Safari on my iPhone 4, and got the value 2.
> Isn’t this what you are asking for?
>    -- Darin
> _______________________________________________
> webkit-dev mailing list
> webkit-dev at lists.webkit.org
> http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

More information about the webkit-dev mailing list