[Webkit-unassigned] [Bug 51190] -webkit-min-device-pixel-ratio selector not changing on zoom event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 25 10:01:58 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=51190





--- Comment #1 from Charles Pritchard <chuck at jumis.com>  2011-03-25 10:01:58 PST ---
This works for Firefox 4, when using browser zoom:

// http://kb.mozillazine.org/Toolkit.zoomManager.zoomValues
#canvas.CompatibilityMozScreen { width: 1px; }
@media all and (min--moz-device-pixel-ratio: .3) {
 #canvas.CompatibilityMozScreen { width: .3px; }
}
@media all and (min--moz-device-pixel-ratio: .5) {
 #canvas.CompatibilityMozScreen { width: .5px; }
}
@media all and (min--moz-device-pixel-ratio: .67) {
 #canvas.CompatibilityMozScreen { width: .67px; }
}


This does not work in WebKit:
@media all and (-webkit-min-device-pixel-ratio: .8) {
 #canvas.CompatibilityMozScreen { width: .8px; }
}
@media all and (-webkit-min-device-pixel-ratio: 1) {
 #canvas.CompatibilityMozScreen { width: 1px; }
}
@media all and (-webkit-min-device-pixel-ratio: 2) {
 #canvas.CompatibilityMozScreen { width: 2px; }
}

Currently, in webkit, I must look at window.innerWidth / window.outerWidth
or some document.body metrics in comparison.

Microsoft simply exposes the values in window.screen.

WebKit only exposes window.devicePixelRatio as a value other than 1, on mobile distributions. I need the current 'zoom' of the user, so that I can show them crisp/clear renderings in <canvas> and use alternate image resources. This is an important issue for accessibility.

Mozilla has a different model for their window.*width mechanics than webkit. This split happened many years ago, and should not get-in-the-way of fixing the issue I'm bringing forward.

Mozilla does not expose a mutated devicePixelRatio directly, they require the CSS hack above to access the data. They do expose it directly to trusted scripts (browser extensions).

If there is a "consensus" standard, it's the CSS selectors. Otherwise, follow Microsoft's route, of simply putting the X dpi / Y dpi in the window.screen object. I don't see a need to create a third option.


-Charles

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list