[webkit-dev] Canvas backing resolution

Charles Pritchard chuck at jumis.com
Tue Apr 5 21:52:00 PDT 2011


Did this move anywhere?

http://www.w3.org/Bugs/Public/show_bug.cgi?id=11328
https://bugs.webkit.org/show_bug.cgi?id=51190
http://code.google.com/p/chromium/issues/detail?id=66656

Firefox is a nasty CSS hack, but it does work, and that's something to 
be happy about.
Microsoft makes it easy; Firefox developers have said they do not want 
it to be "easy".
http://msdn.microsoft.com/en-us/library/ms535868(v=vs.85).aspx

https://bugzilla.mozilla.org/show_bug.cgi?id=486200
 From Robert O, reflecting Mozilla's policy: "I don't want Web authors 
to have easy access to information about screen pixels.
They'll try to defeat our zooming or size things to screen pixels, which 
we don't want."

WebKit and MS already diverge from Firefox in handling of 
window.innerWidth/innerHeight and window.screen properties.
That's not news.

I'd really like to see a resolution to this issue. The hacks I'm using 
just aren't stable in the long term.
I'd prefer the property were just exposed to the DOM via window.screen, 
as MS has done it,
but I'm ok doing CSS media queries.

It's just that media queries require something of a brute-force of case 
statements;
I have about ~12 media queries to handle Firefox, all just repeating min 
media query,
trying to narrow down the resolution.


Long-story-short, can we please expose some of the CSS pixel scaling, 
either through window.devicePixelRatio,
through CSS media queries on device-pixel-ratio, or through the 
window.screen object, in a way similar to
how MS has done it

Anything will work.. I just need one.


-Charles

On 3/4/2011 12:02 PM, Kenneth Rohde Christiansen wrote:
> Hi Simon,
>
> I guess you could use the media query listener defined in
> http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface
>
> We support that on trunk now. This of course means that we will need
> to reevaluate the CSS when a pinch zoom ends, which we might be doing
> already given media queries such as @media all and (min-width: 200px).
>
> Cheers
> Kenneth
>
> On Fri, Mar 4, 2011 at 8:47 PM, Simon Fraser<simon.fraser at apple.com>  wrote:
>> On Mar 4, 2011, at 11:24 AM, Kenneth Rohde Christiansen wrote:
>>
>>> Hey Oliver!
>>>
>>> If you are saying that device-pixel-ratio should include the user
>>> scaling, then I can push that for Qt, but I would really like seeing
>>> it supported by iOS as well for compatibility reasons. If you create a
>>> bug for that, please cc me.
>> There's a problem with that, which is that the author can assume (possibly erroneously) that device-pixel-ratio doesn't change for the life of the page. However, the zoom level can change often, and there's no notification that the author can register for that will tell them when the zoom level changes, and thus when they'll need to redraw their canvas contents.
>>
>> Simon
>>
>>
>
>



More information about the webkit-dev mailing list