Last major update on 14 November 2008.
These compatibility tables detail support for the W3C CSSOM View specification in all modern browsers.
These properties hold the dimensions of the entire browser window.
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 | ||||||
innerWidth and innerHeight
The dimensions of the viewport (interior of the browser window)
Test page |
To be tested | Incor |
To be tested | To be tested | Yes | Yes | To be tested | To be tested | Yes | Incor |
Yes | To be tested | To be tested | Yes | Incor |
To be tested | To be tested | |||||||
window.innerWidth window.innerHeight
|
||||||||||||||||||||||||
outerWidth and outerHeight
The dimensions of the entire browser window (including taskbars and such)
Test page |
To be tested | Incor |
To be tested | To be tested | Yes | 0 | To be tested | Incor |
Yes | Incor |
To be tested | To be tested | No | No | To be tested | To be tested | ||||||||
window.outerWidth window.outerHeight
|
||||||||||||||||||||||||
pageXOffset and pageYOffset
The amount of pixels the entire pages has been scrolled
Test page |
To be tested | Incor |
To be tested | To be tested | 0 | Yes | To be tested | Yes | 0 | Yes | To be tested | To be tested | Yes | No | To be tested | To be tested | ||||||||
window.pageXOffset window.pageYOffset
|
||||||||||||||||||||||||
screenX and screenY
The position of the browser window on the screen
Test page |
To be tested | 0 | To be tested | To be tested | 0 | 0 | To be tested | 0 | Incor |
0 | Incor |
To be tested | To be tested | No | No | To be tested | To be tested | |||||||
window.screenX window.screenY On mobiles we generally expect the value 0 because the browser screen takes the entire screen.
|
||||||||||||||||||||||||
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 |
These properties hold information about the screen.
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 | ||||||
availWidth and availHeight
The available width and height on the screen (excluding OS taskbars and such)
Test page |
To be tested | Yes | To be tested | To be tested | eq. width/h | eq. width/h | To be tested | Yes | eq. width/h | Incor |
To be tested | To be tested | eq. width/h | eq. width/h | To be tested | To be tested | ||||||||
screen.availWidth screen.availHeight |
||||||||||||||||||||||||
colorDepth
The color depth (in bits) of the screen
Test page |
To be tested | 16 | To be tested | To be tested | 32 | 16 | To be tested | Yes | 16 | 32 | 16 | To be tested | To be tested | 16 | 16 | To be tested | 32 | |||||||
screen.colorDepth |
||||||||||||||||||||||||
pixelDepth
Same as colorDepth
Test page |
To be tested | 16 | To be tested | To be tested | 32 | 16 | To be tested | Yes | 16 | 32 | 16 | To be tested | To be tested | 16 | 16 | To be tested | 32 | |||||||
screen.pixelDepth The difference between colorDepth and pixelDepth is only important on (older?) Unix machines, where old X-clients may allow applications to define their own color scheme. If that’s the case, colorDepth matches the color depth of the application and pixelDepth the color depth of the monitor. In all other cases they’re equal. |
||||||||||||||||||||||||
width and height
The width and height of the screen
Test page |
To be tested | Yes | To be tested | To be tested | Yes | Yes | To be tested | Yes | Incor |
To be tested | To be tested | Yes | Yes | To be tested | To be tested | |||||||||
screen.width screen.height
|
||||||||||||||||||||||||
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 |
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 | ||||||
element
Returns the element located at the given coordinates
Test page |
To be tested | Incor |
To be tested | To be tested | Untest |
Yes | To be tested | Yes | Alter |
Untest |
Alter |
To be tested | To be tested | No | No | To be tested | To be tested | |||||||
document.elementFromPoint(100,100) Which coordinates does Alternative: Browser uses
This method is a godsend for drag and drop scripts. When the user drops the dragged element, figure out what element is located at the drop point and go on from there. No more complicated calculations necessary. However, you need to temporarily hide the dragged object. By definition it's the topmost element on the requested coordinates, and we need to know what's underneath it. The basic trick is: releaseElement: function(e) { // called onmouseup var evt = e || window.event; draggedObject.style.display = 'none'; var receiver = document.elementFromPoint(evt.clientX,evt.clientY); if (receiver.nodeType == 3) { // Opera receiver = receiver.parentNode; } draggedObject.style.display = ''; Now |
||||||||||||||||||||||||
getBounding
Gets the encompassing rectangle
Test page |
To be tested | Possibly correct | To be tested | To be tested | Untest |
No | To be tested | No | Untest |
No | To be tested | To be tested | No | No | To be tested | To be tested | ||||||||
x.getBoundingClientRect() Returns an object that contains the IE handles this correctly, provided you accept its incorrect calculation of the individual rectangles.
|
||||||||||||||||||||||||
getClient
Gets the several rectangles of an element
Test page |
To be tested | Possibly correct | To be tested | To be tested | Untest |
No | To be tested | No | Untest |
No | To be tested | To be tested | No | No | To be tested | To be tested | ||||||||
x.getClientRects() Returns a list with Rectangle objects that contain the The trick here is, that an inline element such as an
|
||||||||||||||||||||||||
scrollIntoView()
Makes an element scroll into view (Not part of the specification) Test page |
To be tested | Incom |
To be tested | To be tested | No | Yes | Incom |
Yes | To be tested | Incom |
Yes | No | Yes | To be tested | To be tested | No | No | To be tested | To be tested | |||||
x.scrollIntoView() Element Essentially element
| ||||||||||||||||||||||||
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 |
These properties give information about the dimensions of an Element node (HTML tag).
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 | ||||||
clientLeft and clientTop
The position of the upper left corner of the content field relative to the upper left
corner of the entire element (including borders)
Test page |
To be tested | Yes | To be tested | To be tested | Yes | No | To be tested | Yes | To be tested | To be tested | No | No | To be tested | To be tested | ||||||||||
x.clientLeft x.clientTop |
||||||||||||||||||||||||
clientWidth and clientHeight
The width and height of the content field, excluding border and scrollbar, but including padding
Test page |
To be tested | Yes | To be tested | To be tested | Yes | Yes | To be tested | Yes | Almost | Incor |
Yes | To be tested | To be tested | Yes | No | To be tested | To be tested | |||||||
x.clientWidth x.clientHeight
|
||||||||||||||||||||||||
offsetLeft and offsetTop
The left and top position of the element relative to its offsetParent.
Test page |
To be tested | Yes | To be tested | To be tested | Untest |
Yes | To be tested | Yes | To be tested | To be tested | Yes | Yes | To be tested | To be tested | ||||||||||
x.offsetLeft x.offsetTop |
||||||||||||||||||||||||
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 | ||||||
offsetParent
The ancestor element relative to which the offsetLeft/Top are calculated.
Test page |
To be tested | Yes | To be tested | To be tested | Untest |
Yes | To be tested | Yes | Untest |
Yes | To be tested | To be tested | Yes | Incor |
To be tested | To be tested | ||||||||
x.offsetParent When calculating the
The In IE and Opera
elements with
|
||||||||||||||||||||||||
offsetWidth and offsetHeight
The width and height of the entire element, including borders
Test page |
To be tested | Yes | To be tested | To be tested | Yes | Yes | To be tested | Yes | To be tested | To be tested | Yes | Incor |
To be tested | To be tested | ||||||||||
x.offsetWidth x.offsetHeight
|
||||||||||||||||||||||||
scrollLeft and scrollTop
The amount of pixels the element has scrolled. Read/write.
Test page |
To be tested | 0 | To be tested | To be tested | 0 | Yes | To be tested | Yes | 0 | 0 | 0 | To be tested | To be tested | 0 | No | To be tested | To be tested | |||||||
x.scrollLeft x.scrollTop x.scrollTop = 20 I consider 0 correct if the browser is unable to scroll elements with |
||||||||||||||||||||||||
scrollWidth and scrollHeight
The width and height of the entire content field, including those parts that are
currently hidden.If there's no hidden content it should be equal to clientX/Y. Test page |
To be tested | Yes | To be tested | To be tested | Incor |
Yes | To be tested | Yes | To be tested | To be tested | Incor |
No | To be tested | To be tested | ||||||||||
x.scrollWidth x.scrollHeight When you scroll the element all the way down, If the element has no scrollbars
|
||||||||||||||||||||||||
Selector | Opera Mobile | Opera Mini 4.2 | S60 WebKit | Apple WebKit | Other WebKit | NetFront | Blackberry | IE Mobile | Skyfire | |||||||||||||||
(VF WM) Nokia E66 | (9.5) HTC Touch Diamond | (8.65) SE P1i | (8.00) Motorola V3xx | Nokia E71 | Nokia E66 | Nokia E71 | Nokia N95 | Samsung i560 | iPhone | Android | Bolt (E71) | Iris (HTC) | Samsung F700 | Sony Ericsson K770i | Sony Ericsson C510 | Blackberry 9500 | HTC Touch Diamond | Nokia E71 |