DOMRectReadOnly
interface · experimental
interface DOMRectReadOnlyThe DOMRectReadOnly interface specifies the standard properties (also used by DOMRect) to define a rectangle whose properties are immutable.
variable · experimental
var DOMRectReadOnly: { … }The DOMRectReadOnly interface specifies the standard properties (also used by DOMRect) to define a rectangle whose properties are immutable.
Constructors
constructor
new DOMRectReadOnly(x?: number, y?: number, width?: number, height?: number): DOMRectReadOnlyProperties
bottom
readonly bottom: numberThe bottom read-only property of the DOMRectReadOnly interface returns the bottom coordinate value of the DOMRect. (Has the same value as y + height, or y if height is negative.)
height
readonly height: numberThe height read-only property of the DOMRectReadOnly interface represents the height of the DOMRect.
left
readonly left: numberThe left read-only property of the DOMRectReadOnly interface returns the left coordinate value of the DOMRect. (Has the same value as x, or x + width if width is negative.)
right
readonly right: numberThe right read-only property of the DOMRectReadOnly interface returns the right coordinate value of the DOMRect. (Has the same value as x + width, or x if width is negative.)
top
readonly top: numberThe top read-only property of the DOMRectReadOnly interface returns the top coordinate value of the DOMRect. (Has the same value as y, or y + height if height is negative.)
width
readonly width: numberThe width read-only property of the DOMRectReadOnly interface represents the width of the DOMRect.
x
readonly x: numberThe x read-only property of the DOMRectReadOnly interface represents the x coordinate of the DOMRect's origin.
y
readonly y: numberThe y read-only property of the DOMRectReadOnly interface represents the y coordinate of the DOMRect's origin.
prototype
prototype: DOMRectReadOnlyMethods
toJSON
toJSON(): anyThe DOMRectReadOnly method toJSON() returns a JSON representation of the DOMRectReadOnly object.
fromRect
fromRect(other?: DOMRectInit): DOMRectReadOnlyThe fromRect() static method of the DOMRectReadOnly object creates a new DOMRectReadOnly object with a given location and dimensions.