Just some random notes from the trenches in order to show everyone that, despite appearances, the viewport is not simple or easy to understand.
A browser vendor asked me to study the following problem:
What do browsers do in practice? You may have guessed it: different things. Radically different, and with the single exception of Chrome 31 I cannot find good theoretical underpinnings for their behaviour.
Browser | initial-scale=1 | width= device-width | Both |
---|---|---|---|
Android WebKit | out | in | in |
BlackBerry 10 | out | out | out |
Chrome 28 (Samsung) | in | in | in |
Chrome 31 (Google) | in | out | in |
Firefox 25 | in | in | in |
IE10 | in | in | in |
Safari | out | out | in |
UC9 | out | in | in |
(If the browser has an Out in the initial-scale column, it does not apply the ideal viewport width to the layout viewport; i.e. document.
I see three valid lines of reasoning:
Why does Chrome make sense? Because it zooms in when it encounters an initial-scale, which says something about the zoom level. It does not zoom in when it doesn’t encounter one. width=device-width, strictly speaking, does not say anything about the initial zoom level, so it makes sense to ignore it when it comes to zooming.
At least, that’s how I read the data and the theory now. But the very fact that browsers are all over the place proves that this sort of thing is not easy.
And we need a standard. But what should be in the standard?
This is the blog of Peter-Paul Koch, web developer, consultant, and trainer.
You can also follow
him on Twitter or Mastodon.
Atom
RSS
If you like this blog, why not donate a little bit of money to help me pay my bills?
Categories:
Comments are closed.