The DOMRectReadOnly
interface specifies the standard properties used by DOMRect
to define a rectangle whose properties are immutable.
Constructor
DOMRectReadOnly()
- Defined to create a new
DOMRectReadOnly
object. 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 asy
.) DOMRectReadOnly.right
Read only- Returns the right coordinate value of the
DOMRect
(usually the same asx + width
). DOMRectReadOnly.bottom
Read only- Returns the bottom coordinate value of the
DOMRect
(usually the same asy + height
). DOMRectReadOnly.left
Read only- Returns the left coordinate value of the
DOMRect
(usually the same asx
).
Static methods
DOMRectReadOnly.fromRect()
- Creates a new
DOMRect
object with a given location and dimensions.
Specifications
Specification | Status | Comment |
---|---|---|
Geometry Interfaces Module Level 1The definition of 'DOMRectReadOnly' in that specification. | Candidate Recommendation | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
DOMRectReadOnly
|
Chrome
Full support 61 |
Edge Full support 79 Full support 79 Full support 12 Alternate Name' Uses the non-standard name: |
Firefox
Full support 31 |
IE No support No No support No Full support Yes Alternate Name' Uses the non-standard name: |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
DOMRectReadOnly() constructor
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 62 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 62 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
bottom
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
fromRect() static function
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 69 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
No support No |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
height
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
left
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
right
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
top
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
width
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE No support No No support No Notes' Implemented on the proprietary |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
Available in workers | Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 69 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
No support No |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
x
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
y
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 10.1 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 10.3 |
Samsung Internet Android
Full support 8.0 |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.'
- See implementation notes.
- Uses a non-standard name.'
- Uses a non-standard name.
See also
DOMRectReadOnly by Mozilla Contributors is licensed under CC-BY-SA 2.5.