Last major update on 20 March 2013.
Here’s the inevitable compatibility table that goes with my viewport research. It treats the viewports themselves as well as some related items.
This is the desktop table. See also the mobile table.
This table looks into the properties that are necessary to read out useful information about the two viewports. As you can see, a few browsers make a mess of them, but most suport them well.
Properties | IE8 | IE9 | IE10 | FF 19 Win | FF 19 Mac | Safari 6.0.2 Mac | Chrome 25 Win | Chrome 25 Mac | Yandex 1.5 Mac | Opera 12.14 Win | Opera 12.14 Mac |
---|---|---|---|---|---|---|---|---|---|---|---|
screen.width and screen.height
Screen resolution in device pixels (and not dips). Should not change when the browser is zoomed. |
CSS | CSS | Yes | Yes | Yes | ||||||
|
|||||||||||
window.innerWidth and window.innerHeight
Dimensions of the viewport in CSS pixels, including the scrollbars. |
No | Yes | Yes | Yes | Yes | Yes | |||||
documentElement. clientWidth and documentElement. clientHeight
Dimensions of the viewport in CSS pixels, excluding the scrollbars. |
Yes | Yes | Yes | Yes | Yes | ||||||
documentElement. offsetWidth and documentElement. offsetHeight
Dimensions of the |
client+ | client | Yes | Yes | Yes | Yes | |||||
|
|||||||||||
pageXOffset and pageYOffset
Scrolling offset of the page in CSS pixels. |
No | Yes | Yes | Yes | Yes | Yes | |||||
devicePixelRatio
device pixels divided by dips |
No | Incor |
Yes | Yes | Yes | ||||||
|
Properties | IE8 | IE9 | IE10 | FF 19 Win | FF 19 Mac | Safari 6.0.2 Mac | Chrome 25 Win | Chrome 25 Mac | Yandex 1.5 Mac | Opera 12.14 Win | Opera 12.14 Mac |
---|---|---|---|---|---|---|---|---|---|---|---|
clientX/Y
In CSS pixels, relative to the visual viewport |
Yes | Yes | Yes | Yes | Yes | ||||||
clientX/Y = pageX/Y - window.pageX/YOffset |
|||||||||||
pageX/Y
In CSS pixels, relative to the layout viewport |
No | Yes | Yes | Yes | Yes | Yes | |||||
pageX/Y uses the same coordinate system as |
|||||||||||
screenX/Y
In device pixels, relative to the visual viewport |
CSS | Yes | Yes | Yes | Yes | CSS | |||||
|