DOMRectReadOnly

Draft
This page is not complete.

This is an experimental technology
Check the Browser compatibility table carefully before using this in production.

The DOMRectReadOnly interface specifies the standard properties used by DOMRect to define a rectangle.

Constructor

DOMRectReadOnly()
Defined to create a new DOMRectReadOnly object, but note that this constructor cannot be called by 3rd party JavaScript: doing so returns an "Illegal constructor" typeError.

Properties

DOMRectReadOnly.x Read only
The x coordinate of the DOMRect's origin.
DOMRectReadOnly.y Read only
The y coordinate of the DOMRect's origin.
DOMRectReadOnly.width Read only
The width of the DOMRect.
DOMRectReadOnly.height Read only
The height of the DOMRect.
DOMRectReadOnly.top Read only
Returns the top coordinate value of the DOMRect (usually the same as y.)
DOMRectReadOnly.right Read only
Returns the right coordinate value of the DOMRect (usually the same as x + width).
DOMRectReadOnly.bottom Read only
Returns the bottom coordinate value of the DOMRect (usually the same as y + height).
DOMRectReadOnly.left Read only
Returns the left coordinate value of the DOMRect (usually the same as x).

Methods

DOMRectReadOnly.fromRect()
Creates a new DOMRect object with a given location and dimensions.

Specifications

Specification Status Comment
Geometry Interfaces Module Level 1
The definition of 'DOMRectReadOnly' in that specification.
Candidate Recommendation Initial definition.

Browser compatibility

Update compatibility data on GitHub
DesktopMobile
ChromeEdgeFirefoxInternet ExplorerOperaSafariAndroid webviewChrome for AndroidEdge MobileFirefox for AndroidOpera for AndroidSafari on iOSSamsung Internet
Basic supportChrome Full support YesEdge No support No
No support No
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: ClientRect
Firefox Full support YesIE No support No
No support No
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: ClientRect
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
No support No
Full support Yes
Alternate Name
Alternate Name Uses the non-standard name: ClientRect
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
DOMRectReadOnly() constructorChrome Full support YesEdge No support NoFirefox Full support YesIE No support NoOpera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
fromRect
Experimental
Chrome Full support 57Edge ? Firefox ? IE ? Opera Full support 44Safari ? WebView Android Full support 57Chrome Android Full support 57Edge Mobile ? Firefox Android ? Opera Android Full support 44Safari iOS ? Samsung Internet Android ?
bottomChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
heightChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
leftChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
rightChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
topChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
widthChrome Full support YesEdge No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Full support YesIE No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Opera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support No
Notes
No support No
Notes
Notes Implemented on the proprietary ClientRect interface.
Firefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
xChrome Full support YesEdge No support NoFirefox Full support YesIE No support NoOpera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?
yChrome Full support YesEdge No support NoFirefox Full support YesIE No support NoOpera Full support YesSafari Full support 10.1WebView Android Full support YesChrome Android Full support YesEdge Mobile No support NoFirefox Android Full support YesOpera Android Full support YesSafari iOS Full support 10.1Samsung Internet Android ?

Legend

Full support  
Full support
No support  
No support
Compatibility unknown  
Compatibility unknown
Experimental. Expect behavior to change in the future.
Experimental. Expect behavior to change in the future.
See implementation notes.
See implementation notes.
Uses a non-standard name.
Uses a non-standard name.

See also

Document Tags and Contributors

Last updated by: sideshowbarker,