Firefox Tomorrow

web api interface

DOMQuad

View on MDN ↗

Available in workers

A DOMQuad is a collection of four DOMPoints defining the corners of an arbitrary quadrilateral. Returning DOMQuads lets getBoxQuads() return accurate information even when arbitrary 2D or 3D transforms are present. It has a handy bounds attribute returning a DOMRectReadOnly for those cases where you just want an axis-aligned bounding rectangle.

Constructor

Instance properties

  • p1 Read only
    • : A DOMPoint representing one corner of the DOMQuad.
  • p2 Read only
    • : A DOMPoint representing one corner of the DOMQuad.
  • p3 Read only
    • : A DOMPoint representing one corner of the DOMQuad.
  • p4 Read only
    • : A DOMPoint representing one corner of the DOMQuad.

Instance methods

  • getBounds()
    • : Returns a DOMRect object with the coordinates and dimensions of the DOMQuad object.
  • toJSON()
    • : Returns a JSON representation of the DOMQuad object.

Static methods

  • DOMQuad.fromQuad()
    • : Returns a new DOMQuad object based on the provided set of coordinates in the shape of another DOMQuad object.
  • DOMQuad.fromRect()
    • : Returns a new DOMQuad object based on the provided set of coordinates in the shape of a DOMRect object.

Specifications

SpecificationsStandards references are available on the canonical MDN page.

Browser compatibility

Browser compatibilityCompatibility data is available on the canonical MDN page.