<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
On 11/24/2010 1:12 AM, Robert O'Callahan wrote:
<blockquote
cite="mid:AANLkTim8QgOcWsOm8edtVmXqRWh=rpJaML78q2xo3z4r@mail.gmail.com"
type="cite">On Wed, Nov 24, 2010 at 9:09 PM, Charles Pritchard <span
dir="ltr"><<a moz-do-not-send="true"
href="mailto:chuck@jumis.com">chuck@jumis.com</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
0.8ex; border-left: 1px solid rgb(204, 204, 204);
padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<div class="im"> On 11/21/2010 4:12 PM, Robert O'Callahan
wrote:
<blockquote type="cite">On Sun, Nov 21, 2010 at 9:59 AM,
Charles Pritchard <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:chuck@jumis.com"
target="_blank">chuck@jumis.com</a>></span>
wrote:<br>
<div class="gmail_quote">
<blockquote class="gmail_quote" style="margin: 0pt 0pt
0pt 0.8ex; border-left: 1px solid rgb(204, 204,
204); padding-left: 1ex;"> Rob: Mobile deployments
using dpiPixelRatio (as has been adopted by Moz and
Webkit) and target-DpiDensity work well on the
mobile, they are not hooked to zoom on the desktop,<br>
</blockquote>
<div><br>
It is in Firefox.<br>
</div>
</div>
</blockquote>
</div>
I just tested in 4b7, and it's not changing dpiPixelRatio.<br>
</div>
</blockquote>
<div><br>
Try this:<br>
<style><br>
div { display:none; }<br>
@media screen and (min--moz-device-pixel-ratio: 1.5) {<br>
.in { display:block; }<br>
}<br>
@media screen and (max--moz-device-pixel-ratio: 0.66666666) {<br>
.out { display:block; }<br>
}<br>
</style><br>
<div class="in">Zoomed in by a factor of at least
1.5</div><br>
<div class="out">Zoomed out by a factor of at least
1.5</div><br>
<br>
Try zooming in a lot and zooming out a lot. It works for me.<br>
</div>
</div>
</blockquote>
<br>
I've started working to get this behavior supported in webkit.<br>
<br>
Currently, nobody is touching the devicePixelRatio [mislabeled
dpiPixelRatio in my prior e-mails],<br>
outside of the mobile device atmosphere. As such, the CSS
device-pixel-ratio and window.devicePixelRatio<br>
should be considered two different things. An unfortunate naming
overlap.<br>
<br>
I'd hoped for a cleaner resolution to the issue.<br>
<br>
This represents my existing understanding of the consequences of
Mozilla's don't-make-it-easy policy:<br>
<br>
var mozObfuscatedRatio = 0;<br>
if(window.devicePixelRatio != 1) mozObfuscatedRatio =
window.devicePixelRatio;<br>
else if(window.mozDevicePixelRatio != 1) mozObfuscatedRatio =
window.mozDevicePixelRatio;<br>
else while(mozObfuscatedRatio < 10) {<br>
mozObfuscatedRatio += .1;<br>
if (false === matchMedia('(min--moz-device-pixel-ratio:
'+(mozObfuscatedRatio)+')').matches ) {<br>
mozObfuscatedRatio -= .1; break;<br>
}<br>
}<br>
<br>
The numbers should be tuned for typical zoom steps.<br>
<br>
This doesn't feel like a win for anybody. <br>
<br>
We couldn't even begin to talk about normalizing
window.innerWidth/window.outerWidth .<br>
Mozilla's practice of normalizing all metrics to CSS units makes a
lot of sense. <br>
Obfuscating access to device-pixel-ratio does not.<br>
<br>
<br>
-Charles<br>
<br>
In response to fiddling with ImageData: looks like a related
conversation took place in 2008:<br>
<a
href="http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-February/013923.html">http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2008-February/013923.html</a><br>
<br>
</body>
</html>