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.
DOMRectReadOnly()
DOMRectReadOnly
object, but note that this constructor cannot be called by 3rd party JavaScript: doing so returns an "Illegal constructor" typeError.DOMRectReadOnly.x
Read only
DOMRect
's origin.DOMRectReadOnly.y
Read only
DOMRect
's origin.DOMRectReadOnly.width
Read only
DOMRect
.DOMRectReadOnly.height
Read only
DOMRect
.DOMRectReadOnly.top
Read only
DOMRect
(usually the same as y
.)DOMRectReadOnly.right
Read only
DOMRect
(usually the same as x + width
).DOMRectReadOnly.bottom
Read only
DOMRect
(usually the same as y + height).DOMRectReadOnly.left
Read only
DOMRect
(usually the same as x
).DOMRectReadOnly.fromRect()
DOMRect
object with a given location and dimensions.Specification | Status | Comment |
---|---|---|
Geometry Interfaces Module Level 1 The definition of 'DOMRectReadOnly' in that specification. | Candidate Recommendation | Initial definition. |
Desktop | ||||||
---|---|---|---|---|---|---|
Chrome | Edge | Firefox | Internet Explorer | Opera | Safari | |
Basic support | Yes | No
|
Yes | No
|
Yes | 10.1 |
DOMRectReadOnly() constructor |
Yes | No | Yes | No | Yes | 10.1 |
fromRect
|
57 | ? | ? | ? | 44 | ? |
bottom |
Yes | No
|
Yes | No
|
Yes | 10.1 |
height |
Yes | No
|
Yes | No
|
Yes | 10.1 |
left |
Yes | No
|
Yes | No
|
Yes | 10.1 |
right |
Yes | No
|
Yes | No
|
Yes | 10.1 |
top |
Yes | No
|
Yes | No
|
Yes | 10.1 |
width |
Yes | No
|
Yes | No
|
Yes | 10.1 |
x |
Yes | No | Yes | No | Yes | 10.1 |
y |
Yes | No | Yes | No | Yes | 10.1 |
Mobile | |||||||
---|---|---|---|---|---|---|---|
Android webview | Chrome for Android | Edge Mobile | Firefox for Android | Opera for Android | iOS Safari | Samsung Internet | |
Basic support | Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
DOMRectReadOnly() constructor |
Yes | Yes | No | Yes | Yes | 10.1 | ? |
fromRect
|
57 | 57 | ? | ? | 44 | ? | ? |
bottom |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
height |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
left |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
right |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
top |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
width |
Yes | Yes | No
|
Yes | Yes | 10.1 | ? |
x |
Yes | Yes | No | Yes | Yes | 10.1 | ? |
y |
Yes | Yes | No | Yes | Yes | 10.1 | ? |
© 2005–2018 Mozilla Developer Network and individual contributors.
Licensed under the Creative Commons Attribution-ShareAlike License v2.5 or later.
https://developer.mozilla.org/en-US/docs/Web/API/DOMRectReadOnly