web api interface
DOMRectReadOnly
Available in workers
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.
- : Defined to create a new
Instance properties
xRead only- : Returns the x coordinate of the
DOMRectReadOnly’s origin.
- : Returns the x coordinate of the
yRead only- : Returns the y coordinate of the
DOMRectReadOnly’s origin.
- : Returns the y coordinate of the
widthRead only- : Returns the width of the
DOMRectReadOnly.
- : Returns the width of the
heightRead only- : Returns the height of the
DOMRectReadOnly.
- : Returns the height of the
topRead only- : Returns the top coordinate value of the
DOMRectReadOnly(usually the same asy).
- : Returns the top coordinate value of the
rightRead only- : Returns the right coordinate value of the
DOMRectReadOnly(usually the same asx + width).
- : Returns the right coordinate value of the
bottomRead only- : Returns the bottom coordinate value of the
DOMRectReadOnly(usually the same asy + height).
- : Returns the bottom coordinate value of the
leftRead only- : Returns the left coordinate value of the
DOMRectReadOnly(usually the same asx).
- : Returns the left coordinate value of the
Static methods
DOMRectReadOnly.fromRect()- : Creates a new
DOMRectReadOnlyobject with a given location and dimensions.
- : Creates a new
Instance methods
toJSON()- : Returns a JSON representation of the
DOMRectReadOnlyobject.
- : Returns a JSON representation of the
Specifications
SpecificationsStandards references are available on the canonical MDN page.
Browser compatibility
Browser compatibilityCompatibility data is available on the canonical MDN page.