[css-values-4]: clarification need if absolute length units are zoom independent #8525
Labels
Closed as Question Answered
Used when the issue is more of a question than a problem, and it's been answered.
css-values-4
Current Work
spec: https://w3c.github.io/csswg-drafts/css-values/#absolute-lengths
The current implementation of absolute units in the major browsers scale with browser zoom. This makes the units
density-independent pixels
(dip) since they are seemingly bound by the the user preference for zoom. The definitions seem to heavily focus on print media, which gives the impression that these units should be bound to real life, tangible lengths. But when attempting to use these units, page zoom will scale them up and down.Use case:
https://www.w3.org/TR/mobile-accessibility-mapping/
It would be reasonable to ensure touch targets are 9x9mm because they correspond to a real, physical object (finger or stylus).
Implementation:
We should be able to create a dynamically sized touch target with the following code:
But in practice, this value gets computed down to pixels and scaled. For example, on my monitor, targeting 10mm, would yield fine at 100%:
The small 32x32px buttons would create a bump up to 37.78px, which is closer to ideal. But when zoomed down to 75%, the 32px (now 24x24px) has a equally shrunk down 7.5mm touch target:
Likewise, zoomed to 200%:
Yields a much larger massive 20mm touch size, now being oversized.
Browser state:
Chromium team hasn't addressed this for lack of clarity though specific to print:
https://bugs.chromium.org/p/chromium/issues/detail?id=922695#c9
https://bugs.chromium.org/p/chromium/issues/detail?id=922695#c13
Firefox has a bug detailing how
mm
in Windows isn't accurate: https://bugzilla.mozilla.org/show_bug.cgi?id=667260Firefox used to have a length called
mozmm
that was eventually removed: https://bugzilla.mozilla.org/show_bug.cgi?id=1416564Webkit has an issue showing absolute units are locked to 96dpi: https://bugs.webkit.org/show_bug.cgi?id=11644
The text was updated successfully, but these errors were encountered: