Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Proposal: devs SHOULD NOT use content="user-scalable=no | maximum-scale=1.0 " on meta #602

Closed
stevefaulkner opened this issue Sep 28, 2016 · 41 comments

Comments

@stevefaulkner
Copy link
Contributor

The use of the content="user-scalable=no" and maximum-scale=1.0 on the meta element:

<meta name="viewport" content="user-scalable=no">

<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">

Causes real problems for users on mobile/touch devices. It stops them from being able to zoom content to suit their needs.

One browser has stopped zoom disable being effective: details https://wouterdeschuyter.be/blog/how-to-disable-viewport-scaling-in-ios-10-you-dont-941140811

What I am suggesting is that a normative author recommendation be added to the spec to discourage use of these values along with advice on why. And that conformance checkers should flag uses of these values with a warning.

cc/ @patrickhlauke @sideshowbarker

@patrickhlauke
Copy link
Member

Note that there are some (very specific) use cases where it may be valid to try and suppress user-initiated zooming/pinch-zooming, mostly around situations like maps (where you'd want to handle your own zooming programmatically, e.g. to load higher resolution map tiles, rather than allowing user to just blow up the current set of tiles).

@patrickhlauke
Copy link
Member

And note that before Safari's bold move to basically ignore meta directives that stop pinch-zoom, many browsers already included settings ("Force enable zoom", "Always allow zooming", etc) to disable this.

@stevefaulkner
Copy link
Contributor Author

Note that there are some (very specific) use cases where it may be valid to try and suppress user-initiated zooming/pinch-zooming, mostly around situations like maps (where you'd want to handle your own zooming programmatically, e.g. to load higher resolution map tiles, rather than allowing user to just blow up the current set of tiles).

that's why i am suggesting a normative SHOULD NOT rather than a MUST NOT

@patrickhlauke
Copy link
Member

sure, just suggesting it may be good to include this as a counter-example/exclusion in the actual prose

@stevefaulkner
Copy link
Contributor Author

post by @sturobson Don't do this in responsive web development
http://alwaystwisted.com/articles/2013-01-10-dont-do-this-in-responsive-web-development

@AmeliaBR
Copy link

There's already way too much content on the web using this feature gratuitously (meaning, without offering a custom-zoom alternative, and without respecting other user settings for preferred font size). Adding a warning to validators has little effect on that. The devs who are using validators are probably not the worst offenders.

The way to most effectively get rid of this is at the user agent level. This could be done by making the feature completely obsolete, so that user agents are expected to drop support. Or it could be done by adding a requirement that user agents have a setting that allows users to override any author meta directives like this. (Which would allow the valid use cases to continue.)

@patrickhlauke
Copy link
Member

patrickhlauke commented Sep 28, 2016

The way to most effectively get rid of this is at the user agent level.

Which is what Apple just did (ironic, since they actually invented it), and most other UAs already have at least a setting to ignore it.

This could be done by making the feature completely obsolete, so that user agents are expected to drop support.

The feature is an Apple proprietary invention, and not actually spec'd officially (barring the retrospective https://www.w3.org/TR/css-device-adapt-1/#viewport-meta which is currently only a WD). that's the place where a warning should ideally be placed. [sent email to www-style to that effect, referencing this thread]

Nonetheless, I don't see any harm in mentioning this in the HTML spec / adding a warning in the validator. It won't actually stop devs from using it, but...

@stevefaulkner
Copy link
Contributor Author

@AmeliaBR

Adding a warning to validators has little effect on that. The devs who are using validators are probably not the worst offenders.

we don't know how much effect it will have, but i suggest even a little is a positive thing. Likewise with advice in the HTML spec.

@tagawa
Copy link

tagawa commented Sep 29, 2016

From past experience, this addition would be useful for getting managerial approval or increasing priority within a project, for example being able to say "It's not subjective - W3C spec says we should not be doing this", etc.

@simevidas
Copy link

simevidas commented Sep 29, 2016

@patrickhlauke For the maps use case, isn’t that a job for the CSS touch-action property (MDN)? I.e. disable pinch-to-zoom specifically on the map element. If so, this isn’t a use case for user-scalable=no.

@straker
Copy link

straker commented Sep 29, 2016

Just wanted to chime in from a different perspective just so it's captured and thought about.

A lot of JavaScript games that can be played on a mobile device use that meta tag with user-scalable=no since the entire site is just a big canvas most of the time and the developer takes care of resizing it via JavaScript or CSS to fit the current screen size. Take for example a sampling of games from the recent JavaScript game dev JS13k competition.

As @patrickhlauke said, adding this as an example of when you could property use the meta tag would be helpful, especially if browsers start to disallow the meta tag, as one has done, game devs would have to find a different technique to disable zoom, pitch, and scroll for their games. If there was a definitive example of how to do that without the meta tag, that would probably still be fine but then a lot of older games would have to be updated to use the new syntax.

@anupkumarmaharjan
Copy link

If iOS force fully ignores the user-scalable=no, then it should not scrambles the other design too either the "width=320" or width=device-width is defined in the META tag too. As for now, it is breaking all the design which are not included inside 320px width.

@stevefaulkner
Copy link
Contributor Author

@stevefaulkner
Copy link
Contributor Author

please review the commit text 29b8934 and provide feedback - thanks!

@stevefaulkner
Copy link
Contributor Author

issue raised on validator validator/validator#379

@ghost
Copy link

ghost commented Dec 15, 2016

Hi everybody,

I would like to join this conversation. Well ... All the points mentioned are right. Anyway it is funny that it is Apple which will give the user the freedom of zoom-in-out. Normally Apple user do not have the freedom to self-decide :D joking
For some weeks now Safari does not support this specific meta tag any more. Now I recognized that also the W3C-Validator shows a WARNING better not to use the no-scale-meta tag anymore. I am pretty sure that this feature will die faster than we can imagine. Does anybody have an idea on how to workaround that? @ Steve: I read your links and found a pretty nice JS-snippet: document.addEventListener('gesturestart', function (e) { e.preventDefault(); });

I would say this is working 90%. Means: Sometimes on text or pictures it is possible to zoom. I really don´t want to have the possibility to zoom-in-out for a specific project. So, if there is a better solution ... would be great :)

Thanks
Mike

@marvindanig
Copy link

marvindanig commented Apr 6, 2018

Ability to disable zoomability on web pages is very important for web developers to be able to make performant games or sites with "app-like" behavior. We should note there is a dry reader mode on Safari that helps low vision readers with accessibility, if the site is such and someone needs those overrides.

I tested on iOS 10.3 with a simple event.preventDefault() on touchmove & gesture but it doesn't work as expected. Will have to pass { passive: false } as well to be able to make it work somewhat.

It's a mess!

It's like putting the entire planet on a wheelchair just to guarantee that the differently abled are able to walk. As if all users are my users. That is simply not correct.

@trusktr
Copy link

trusktr commented May 19, 2018

I'm a developer. Let me decide how I want my app to be used. You can make yours fully accessible and I can make mine completely inaccessible, but that doesn't matter, we should all have a choice. Safari's move is crippling to freedom.

@tagawa
Copy link

tagawa commented May 19, 2018

I'm a user. Let me decide how I want to use an app.

@alastc
Copy link

alastc commented May 19, 2018

The user’s ability to manipulate the interface provided has long been a tenant of the web.

Overall, I suspect there are far more sites that use max-scale=1 without needing to, compared to the sites which have a valid case.

I’m curious about whether using a meta viewport setting is the best method to over-ride pinch-zoom for the valid cases like games and full-screen maps. If you are doing that type of app, presumably you are handling most or all gestures. If you are handling them, does the metaviewport even matter? (e.g. I notice that Google maps still works as intended on iOS.)

@marvindanig
Copy link

marvindanig commented May 19, 2018

@alastc we're missing the point here. It is an "accessibilty guideline" and not a law. Guidelines should be treated as such because otherwise it'd be something more draconian.

If sites are misusing the clause without needing to and are downright inaccessible then those sites will wither away and die themselves.

Why should a vendor extend life-support of such badly made sites and ruin the experience for everyone else for a longer period of time?

Edits: working on making English my first language.

@marvindanig
Copy link

marvindanig commented May 19, 2018

@tagwaa if you are a user of maps you don't want pinchzoom to scale up surrounding text. You want to zoom into the map instead for greater detail. And that's exactly the argument @trusktr made with his comments. And I agree with him.

@aardrian
Copy link

@marvindanig:

It is an "accessibilty guideline" and not a law.

WCAG is incorporated into many laws by reference. In the U.S., Canada, European Union, etc. While law / WCAG is not what this thread is about, I can't let that assertion go unaddressed.

@patrickhlauke
Copy link
Member

the spec reflects reality. reality is that Safari ignores any attempts at blocking resizing via meta outright, and most other browsers provide user settings to ignore it as well.

if you don't like what Safari does, take it up with apple, not the spec.

@marvindanig
Copy link

marvindanig commented May 19, 2018

We can put it to the test for any given question of course, but without some obvious exceptional feature of a case it generally seems like a waste of time, so the onus is generally on those arguing for the exception to show we should re-open such decisions.

Awesome @chaals, so let me throw in some obvious features and reasoning behind this:

1. Let's take the case of iPads first.

I know everything gets lumped together into one big category -- the "mobile web" -- but here we're on a nice, large and clear piece of glass with iOS Safari. Do we need pinch_to_zoom to bring up text any closer (appear bigger) than it already is on the iPad? Nope, not really.

Much of the "scale_the_text" need is met by the sheer size of the tablet and the only meaningful usecases left to explore on iPad with pinchzoom are map-zooming, hires-image zooming and perhaps gaming where intercepted interface using javascript will presumably cover all scenarios.

On the flipside however forcing pinchzoom to scale up the viewport almost always stifles the user experience (and the developer) at every step of the way. Safari/vendor incorrectly assumes a doubletap gesture and zooms in where ever and whenever a finger misses the spot or a button. It obviously frustrates the user who ends up hitting the reload button to restore the page back to its glory; or double-tap again for the frame to fall back in place.

Thus a question: how will developers like me make a "tablet-first" website without first removing the burden of issues that leak from mobile world? Specifically, with our inability to prevent pinchzoom=>windowscaling simply.

On accessibility, I know a few folks with low-vision challenges who bought the iPad only because of its physical size. Not one of them feels the need to pinchzoom for anything other than gaming, or deeper view of images or maps. Flamecharts is perhaps another example where pinchzoom is needed, but it's a developer usecase. My data here is obviously anecdotal but I can't think of a situation where the original purpose of pinchzoom/scaleWindow would hold good on a tablet. Also, there is reader mode on Safari/Firefox that provides for an adless, clutterless reading experience while also fulfiling deeper accessibility guidelines fully well.

From a dreamy HIPPO standpoint, I am leaning towards the fact that the screen size of iPads/tablets is large (being fairly close to that of a desktop) and that offline-first approach makes it possible to do complex apps on web. It is perhaps in our interest to let people choose a configuration for their apps simply. To that end it would be an important step for us to be able to disable pinchzoom on webpages, lock the parent frame at its initial position, and intercept multifinger touches for any other action like drawing, sketching, gaming, maps, interactive videos, AR/VR etc.

My wife uses the iPad Safari to read books online like this: https://bubblin.io/book/pride-and-prejudice-by-jane-austen/1

Sacrilege interface from a "desktop/pointer-driven web" standpoint, but a real one nevertheless.

2. Case of smartphones.

I know scratchpads need the parent frame to remain locked in its place. Most drawing apps, maps, games, video players would in general? I know that fullscreen api is coming to iOS Safari soon so at that point it will be important to not force pinchzoom/textscaling on every other usecase. Real estate may still be (was?) an issue on mobile, and we all know that content doesn't scale easily. Not without triggering a reflow. Responsive design helps but it doesn't solve the problem entirely, leaving us with sites having illegible text that could only be hacked over to scale with pinchzoom. And therefore, disabling pinchzoom even casually on a text-primary website is a strict no-go.

I understand this and believe we are all on the same page here.

Since we're on text scaling, let's take reflow into account more closely because it matters.

A blogpost on Medium, for example, that is easy to scroll by on the desktop is rather inaccessible on mobile. Why so? A 5,000 words essay split into 20 paragraphs each looks great on the desktop. But on mobile the same blogpost reflows into a long and rather endless scroll in a shape of what some would call a thick "billing paper" roll.

This makes the lower half of the article inaccessible by default.

I guess anything that is over 10-20 swipes down can be safely assumed as inaccessible. Pagination helps here, but that's another story to discuss. I did a small experiment to highlight the issue with some swipe math:

Here's a website (book?) on essentials of image optimisations by Addy Osmani.

It took me ~90 (+/- 5) scroll swipes on the mouse to reach the end of the book while making sure I saw all of the content. Emulating real reading.

The same site on iPhone 10 took ~194 swipes to scroll down to the bottom and ~244 swipes on an Android Galaxy Express 3 when making sure I saw all the content at least once. I don't know about others, but I'd never scroll down that deep into a scroll for any post that is longer than 30 swipes. Maximum 40. It's just too much to ask.

Worse still, if I accidentally touch the bezel on top of my phone, the site scrolls back to the top from the middle of the book! Now I have to swipe back at least 92 times before I can reach the spot where I was lifted from. Anyway, we digress.

So the point here is that accessibility is a double-edged sword and we can't apply (or force) a set of rules from one situation to another and expect to cover the entire spectrum of use cases on web in one broad stroke. Web is no longer a desktop-only paradigm. On these lines, the ability to disable pinchzoom/scaling without using javascript hacks is critical to the success of a web developer.

IMHO, we should remain flexible and let people choose what is right for them/their audiences.

Hence, the question: Is there a non-hacky way to prevent pinchzoom on iOS Safari

Edits: Plenty.

@marvindanig
Copy link

marvindanig commented May 19, 2018

@aardrian Great point!

All the more important for WCAG/web committees to not recommend accessibility guidelines that can be misused as laws by big-rigs as their corporate strategy!

Some weekend dystopia fun: With Governments morphing into authoritarian regimes, it is important we be careful about choosing guidelines correctly with our future in mind, not just our current reality.

@patrickhlauke we did!

Not that they are doing this, but Apple (or anyone) could easily use accessibility guidelines from WCAG to mask their corporate strategy for native app stores and compel their decision on all developers. I understand that the spec is reflecting our current reality but it's certainly not a constraint. Nor should be.

Although I admit here that I don't understand the process of "spec making" enough so my comments on this forum could easily be stupid.

@alastc
Copy link

alastc commented May 19, 2018

We seem to be heading off piste pretty quickly here, I'll try and keep this concise:

  • There has been an accessibility guideline since 2008 (WCAG 2.0) that says the user should be able to increase the text-size by at least 200%.
  • Most mobile devices enable that with pinch-zoom, either by default or with a setting.
  • The cases brought up about specific devices are not particularly relevant, if someone needs larger text due to low vision they should be able to do so. (Also, the effective pixel size varies according to intended device usage, so the larger screen doesn't necessarily help.)
  • The fact that the example @marvindanig provides (bubblin.io/book/) does disable pinch-zoom on my iOS phone proves that the meta-viewport setting is not needed for that purpose. (NB: It should really provide a method of adjusting text-size, although I suppose you could just download an epub version.)
  • If it is difficult to disable pinch-zoom: That is probably a good thing as it restricts that approach to where it is really needed.

@marvindanig
Copy link

marvindanig commented May 19, 2018

Good observation @alastc but unfortunately your conclusions are incorrect.

  1. Bubblin uses hacks to disable pinchzoom. I'd want to not use those hacks. The container it uses doesn't restrict text scaling or the number of copies that you could make for the same book using different text sizes, layout or typography.

  2. Ideally, for my books I'd want to disable pinchzoom only on iPads but not on iPhones but it is a lot of configuration on Bubblin. Hopefully soon, but thanks for the f/b anyway.

On epubs, epubs don't live on web. And that's a bad thing. You're effectively sending people away from web because of the inability to handle longform as was discussed on point #2 of my note above. Glad that the limitations of mobile web bring these weakness of the spec out better, not only for books but also for other stuff like blogposts and plain text articles that reflow too long.

  1. WCAG 2.0 from 2008 reflects realities of 2008? Not sure if tablets were a thing then.

All the cases I've quoted are relevant and real on web, it's another matter you respect those ideas or not.

@alastc
Copy link

alastc commented May 19, 2018

WCAG 2.1 should be published as a recommendation in June 2018, and still includes that requirement because it is a valid & useful requirement for users (it adds other requirements as well).

User requirements are more important than developer requirements (as per WHATWG / W3C priories), and ultimately if the browsers work that way, the spec should reflect that. You might consider it a weakness, others do not.

Anyway, it looks like this bug was closed a couple of years ago...

@marvindanig
Copy link

marvindanig commented May 19, 2018

Sure, I was talking about real user requirements (average people not developers) with a clear scenario of (i) tablets where pinchzoom is likely if not completely unnecessary and (ii) the issue of scrolls on mobile that grow too long to remain tolerable or even accessible due to reflow. Both points that you clearly did not address. I'm sure that this issue will be revisited again sometime in future, so leaving my comments up here for reference then.

Until then committee, adios. ;-)

@patrickhlauke
Copy link
Member

@marvindanig "Do we need pinch_to_zoom to bring up text any closer (appear bigger) than it already is on the iPad? Nope, not really." well, clearly that's just your opinion, and a fairly broad-strokes generalisation at that. just because YOU don't think something's a problem, ever, doesn't mean that that's in fact the case. But yes, it's pointless arguing this point here anyway :)

@LJWatson
Copy link
Collaborator

LJWatson commented May 20, 2018

Would also note the Priority of constituencies from the HTML5 Design principles:
<"In case of conflict, consider users over authors over implementors over specifiers over theoretical purity. In other words costs or difficulties to the
user should be given more weight than costs to authors; which in turn should be given more weight than costs to implementors; which should be given more
weight than costs to authors of the spec itself, which should be given more weight than those proposing changes for theoretical reasons alone. Of course,
it is preferred to make things better for multiple constituencies at once."<

@chaals
Copy link
Collaborator

chaals commented May 20, 2018

This was a concrete practical issue, which was worth examining, and is potentially worth re-examining. But the discussion is getting a lot more heat than light. I'm tempted to close it down for a day or two, but won't yet because I hope people can focus on the issue.

@stevefaulkner
Copy link
Contributor Author

@chaals this proposal resulted in a SHOULD NOT author conformance requirement that has been in the spec since 2016 arronei@877b59c It is an author conformance requirement only, that does not forbid the use but does ask authors to consider seriously the curtailment of user's ability to zoom. What apple have done in safari is beyond the scope of this issue as it does not require anything of browser implementers.

@chaals
Copy link
Collaborator

chaals commented May 20, 2018

@marvindanig, taking my chair hat off and as an individual, I'd like to address a couple of points:

Some people may well be happy with the iPad's physical size, instead of disabling zoom. People with "less than normal" visual acuity deal with it in a variety of ways. So sometimes, I am fine with normal sizes because I don't care about the detailed view - for example a map where I want a rough orientation. In other cases I will zoom really hard to e.g. read street names in very large font. The wdiely divergent forms of visual disability make this divergence even greater. (In general, "everyone I know" is a very useful basis for understanding a thing that people do, but a poor basis for extrapolating that nobody does something). I find your argument that disabling pinch-to-zoom on the iPad is justified doesn't match my own experience, let alone that of some people I know.

Second, accessibility guidelines are not universal laws. The W3C's work is an attempt to formulate technical guidance for a world wide web. Personally, I am unhappy with many examples of adopting them as local laws - because I think there are better ways to make laws. If anything, the guidelines err on the side of caution, so they are likely to be less strict in requirements than is needed - and being technical work, we know they have bugs. But basically, a global communication network and application platform that excludes people just because they have disabilities is not fit for purpose, so accessibility issues do need to be fixed. The principles of the "priority of constituencies" are IMHO a better approach than "we can't be bothered implementing a browser well" or "we don't want some people to find our application functional". But the Web is a practical project, so compromises abound.

Third, reading long form content is not the same as reading something short - either in experience, or the investment I am prepared to make. I rarely watch video because I rarely find it justifies the time, but I read a lot of long-form content. I'm used to the fact that it takes a lot more effort than reading trivial tweets, and do it because I expect to get more value. So again, I reject the idea that some magic number of scroll actions makes the content worthless, because it doesn't match my experience nor that of many users I know who are prepared to read long-form content despite immense difficulty based on a need for interacting with it by making the characters one inch high.

@marvindanig
Copy link

marvindanig commented May 24, 2018

Thanks @stevefaulkner, that's an important bit.

The spec appears to be correct about SHOULD NOT author conformance requirement but does it emphasize that enough? 'Cuz Apple seems to be pushing a way more draconian interpretation of those lines -- a near "MUST NOT conformance requirement" instead.

Of course it helps their cause of "great performant apps" in appstore as well.

On my project (bubblin) we handle longform (books) in a very specific way. The parent window doesn't contain any content. This may be unique to us but all our books are paginated using iframes in what works like a real book. My readers still need pinchzoom ability to scale content up, especially on phone, but that'd work on the whole book itself (which is handled via reader settings).

I need to be able to lock the parent frame and enable pinchzoom at the level of book. This used to be straightforward in earlier versions of Safari but now it's completely broken. And it's rather difficult and expensive (performance hit) to fix it, and not even possible without using hacks at multiple levels.

Even standard things like event.preventDefault() using javascript to intercept behavior on page elements like <body> or <div> or <a> don't work on iOS Safari 11.x and WCAG guidelines are likely encouraging Apple in doing this.


@chaals quick notes:

  1. I agree with you. Let me quickly clarify in continuation of my note above that the need to keep pinchzoom enabled on tablets is not as severe as it is on mobile phones where illegibility of text is a a major issue. This is not an opinion as someone mentioned on this thread elsewhere. Pinchzoom is a great default but it should be easier to override on tablets (than on phones, say), and hopefully with a clause like <meta name="viewport" content="width=device-width, user-scalable=no" />. We need the spec to address this difference between tablets and mobile perhaps.

  2. Priority of constituencies is awesome, thank you for sharing this overview on WCAG with me.

  3. I agree with you that web is generally bad (an opinionated word) at long-form and does require involvement and effort and investment from the reader to dive in and learn despite the difficulties posed by, say, a number of scroll/swipe actions or anything else. I agree with you that a higher number of scroll actions does not make the content worthless either.

But it does make the container less accessible. And that is why we even have pagination!

(Methinks, we're on same page with all of this, correct me if I'm wrong.)

My note above (point number 2) isn't about challenges of long-form at all. I am talking about inaccessibility of something that was "short" or "concise" on the desktop but is "too long" on mobile, and therefore inaccessible.

Example:

Open this blogpost on a desktop: https://medium.com/retronator-magazine/pixels-and-voxels-the-long-answer-5889ecc18190. Proceed to read (make that investment) and you'll be able to do that with fair bit of effort. Now reopen the same blogpost on a phone. Try finishing the article now. You'll find that it is impossible to do so. And oops!, even God cannot help if you accidentally touched the bezel on top of your phone.

Is this a new kind of previously unaddressed inaccessibility?

That said, feel free to reject all my thoughts, feedback and ideas. Mean no disrespect; been a web developer for 15 years and have only thanks to return for the beauty of collective thinking of one and all.

@Dima11235813
Copy link

I found an issue with mobile browsers not respecting the position of fixed that I applied to a static header.

On scroll it would get partially obscured.

I found an article that suggested using js libraries to handle the position fixed situation but warned of the issue of increased complexity and other bugs surfacing due to this fix.

I found that applying user-scalable=no fixed the issue.

Yes, it decreases accessibility and is a fix that I put in place until I find something better, but I think that generally speaking, if your user needs to zoom to read something, then your designs missed the mark.

Of course some people have vision impairments and they need to zoom, which is why I'm on the lookout for a better option.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests