[webkit-dev] Canvas backing resolution

David Hyatt hyatt at apple.com
Wed Apr 6 14:51:44 PDT 2011


On Apr 6, 2011, at 3:01 PM, Charles Pritchard wrote:

> On 4/6/2011 12:32 PM, David Hyatt wrote:
>> 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.
> The descendant elements are under the control of the author.
> 
> That is, if I decide to use  body.style.webkitTransform, in my scripting environment, I'm going to know that,
> because I initiated the request, and I'll add that to my calculations.
> 

Yeah, that's a good point.

> I see adding a pixel ratio property to window.screen as the cleanest solution.

This seems like a decent solution to me.  Probably simplest to just match what WinIE did for compatibility (even though it's two properties).

dave
(hyatt at apple.com)



More information about the webkit-dev mailing list