DOMRectReadOnly
Geometry Interfaces
Geometry Interfaces
The DOMRectReadOnly interface specifies the standard properties (also used by DOMRect) to define a rectangle whose properties are immutable.
Constructor
- DOMRectReadOnly()
- : Defined to create a new
DOMRectReadOnlyobject.
Instance properties
- DOMRectReadOnly.x
- : Returns the x coordinate of the
DOMRectReadOnly's origin. - DOMRectReadOnly.y
- : Returns the y coordinate of the
DOMRectReadOnly's origin. - DOMRectReadOnly.width
- : Returns the width of the
DOMRectReadOnly. - DOMRectReadOnly.height
- : Returns the height of the
DOMRectReadOnly. - DOMRectReadOnly.top
- : Returns the top coordinate value of the
DOMRectReadOnly(usually the same asy). - DOMRectReadOnly.right
- : Returns the right coordinate value of the
DOMRectReadOnly(usually the same asx + width). - DOMRectReadOnly.bottom
- : Returns the bottom coordinate value of the
DOMRectReadOnly(usually the same asy + height). - DOMRectReadOnly.left
- : Returns the left coordinate value of the
DOMRectReadOnly(usually the same asx).
Static methods
- DOMRectReadOnly.fromRect()
- : Creates a new
DOMRectReadOnlyobject with a given location and dimensions.
Instance methods
- DOMRectReadOnly.toJSON()
- : Returns a JSON-serializable plain object representing the
DOMRectReadOnlyobject. Automatically called by JSON.stringify().
Specifications
Browser compatibility
See also
- DOMPoint