Re: [mediaqueries4] zoom-ratio as a media feature

Hi Simon,

Well, even the editor's draft of Device Adaptation spec doesn't  
precisely define "zoom level" or "zoom factor". They just dive right  
in and start using them :)

http://dev.w3.org/csswg/css-device-adapt/#introduction

I don't mean this as a jibe--the point is that it's a "know it because  
you've already used it" concept. The technology is ahead of the  
standard. I agree that it would be great to rigorously define. It's  
not dpr, device pixels, reference pixels, or any simple ratio of the  
above. It is its own thing. It's something that's typically user  
initiated, typically by either (cmd/ctrl +/-) on the keyboard, or  
pinching on touch devices. However, it can also be set by the user  
agent as a result of the @viewport cascade. The spec:

"The ‘min-zoom’, ‘max-zoom’, and ‘zoom’ descriptors must be supported  
as input to the constraining procedure. However, the UA may choose to  
use a different zoom factor when presenting the document to the user,  
and use different minimum and maximum zoom limits for the user  
interaction."

http://dev.w3.org/csswg/css-device-adapt/#conformance

There are already really solid norms for these user actions on  
devices, there's just no standardized way for authors to get at them.  
Media Queries/matchMedia seem like the clearest avenue of approach.

Since the @viewport cascade gets evaluated prior to media queries, one  
issue that I see is whether to report 'user-zoom' specifically  
initiated by the user or a more generalized 'zoom' that factors in  
both user-initiated and UA-initiated zooming. My sense is that it's  
simpler to use the generalized 'zoom', and that it covers the vast  
majority of use cases. Thoughts?

While I'm here, I'd also like to suggest an author recommendation in  
the Device Adaptation spec: that the @viewport 'user-zoom' descriptor  
should generally be set to 'zoom', and not to 'fixed'. This has  
already been litigated, and rejected, because disabling zoom is  
usually terrible for accessibility. I think the spec should be  
generally cautioning authors away from locking the user out.

Thanks,
Alex



Quoting Simon Sapin <simon.sapin@exyr.org>:

> Le 09/10/2013 02:06, Alex Bell a écrit :
>> Hello,
>>
>> Current developer efforts to reliably measure user zoom are basically
>> a shambles. There are dozens of different techniques, none of which
>> are truly comprehensive cross-browser. The most encyclopedic of all
>> approaches, the maniacally detailed 'detect-zoom' has been badly
>> broken on the desktop by recent changes to FF18 and Chrome 27. FF 18+
>> now change the 'devicePixelRatio' value on manual zoom (cmd/ctrl ±),
>> arguably distorting the meaning of the word 'device'. On Chrome,
>> webkitTextSizeAdjust was deprecated on the desktop, the only
>> bulletproof method. For the whole convoluted story see:
>>
>> https://github.com/tombigel/detect-zoom
>>
>> One of the things that seems to trip up all discussion of this is that
>> some code bases tie zoom to resolution, while others do not.
>> Everybody's doing it their own way. This is an area that is just
>> screaming for standardization.
>>
>> I realize I am probably wading into a few long-standing debates here,
>> but IMHO user zoom should be queryable through window.matchMedia. The
>> property could be called 'zoom-ratio', to make it absolutely clear
>> that it's a ratio, and it should accept min/max prefixes. I propose
>> that this be added to Media Queries Level 4.
>>
>> If I'm late to the discussion, or just totally wrong, I would really
>> appreciate a nice clear explanation of why this is impossible, or a
>> bad idea.
>
> Hi,
>
> Before we can discuss whether this is a good idea or if there is a  
> better solution, please provide a well-defined proposal.
>
> What exactly is "user zoom"? If it’s a ratio, between what and what?  
> Note that there are many related concepts here: initial and actual  
> viewport, device pixels and CSS px, etc.
>
> http://dev.w3.org/csswg/css-device-adapt/#initial-viewport
> http://dev.w3.org/csswg/css-device-adapt/#actual-viewport
>
> -- 
> Simon Sapin
>

Received on Friday, 6 December 2013 12:33:21 UTC