DOMRectReadOnly
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
DOMRectReadOnlyobject. Note that this constructor cannot be called by 3rd party JavaScript; doing so returns an"Illegal constructor"TypeError.
Instance properties
DOMRectReadOnly.xRead only-
The x coordinate of the
DOMRect's origin. DOMRectReadOnly.yRead only-
The y coordinate of the
DOMRect's origin. DOMRectReadOnly.widthRead only-
The width of the
DOMRect. DOMRectReadOnly.heightRead only-
The height of the
DOMRect. DOMRectReadOnly.topRead only-
Returns the top coordinate value of the
DOMRect(usually the same asy). DOMRectReadOnly.rightRead only-
Returns the right coordinate value of the
DOMRect(usually the same asx + width). DOMRectReadOnly.bottomRead only-
Returns the bottom coordinate value of the
DOMRect(usually the same asy + height). DOMRectReadOnly.leftRead only-
Returns the left coordinate value of the
DOMRect(usually the same asx).
Static methods
DOMRectReadOnly.fromRect()-
Creates a new
DOMRectobject with a given location and dimensions.
Specifications
| Specification |
|---|
| Geometry Interfaces Module Level 1 # DOMRect |
Browser compatibility
BCD tables only load in the browser