This is an experimental technologyCheck the Browser compatibility table carefully before using this in production.
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
DOMQuad.DOMQuad()- Creates a new
DOMQuadobject.
Properties
- p1,p2,p3,p4 Read only
- are
DOMPointobjects for each of theDOMQuadobject's four corners.
Methods
DOMQuad.fromRect()- Returns a new
DOMQuadobject based on the passed set of coordinates. DOMQuad.fromQuad()- Returns a new
DOMQuadobject based on the passed set of coordinates. DOMQuad.getBounds()- Returns a
DOMRectobject with the coordinates and dimensions of theDOMQuadobject. DOMQuad.toJSON()- Returns a JSON representation of the
DOMQuadobject.
Specifications
| Specification | Status | Comment |
| Geometry Interfaces Module Level 1The definition of 'DOMQuad' in that specification. | Candidate Recommendation | Initial definition. |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
| Desktop | Mobile | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
DOMQuad
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
DOMQuad() constructor
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 31 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 31 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
fromQuad() static function
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 69 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 79 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
fromRect() static function
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 69 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 79 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
getBounds()
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 62 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 62 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
p1
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox Full support 31 Full support 31 Notes' Prior to Firefox 69, the default value of |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android Full support 31 Full support 31 Notes' Prior to Firefox for Android 79, the default value of |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
p2
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox Full support 31 Full support 31 Notes' Prior to Firefox 69, the default value of |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android Full support 31 Full support 31 Notes' Prior to Firefox for Android 79, the default value of |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
p3
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox Full support 31 Full support 31 Notes' Prior to Firefox 69, the default value of |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android Full support 31 Full support 31 Notes' Prior to Firefox for Android 79, the default value of |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
p4
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox Full support 31 Full support 31 Notes' Prior to Firefox 69, the default value of |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android Full support 31 Full support 31 Notes' Prior to Firefox for Android 79, the default value of |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
toJSON()
|
Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 62 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 62 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
| Available in workers | Chrome
Full support 61 |
Edge
Full support 79 |
Firefox
Full support 69 |
IE
No support No |
Opera
Full support 48 |
Safari
Full support 11 |
WebView Android
Full support 61 |
Chrome Android
Full support 61 |
Firefox Android
Full support 79 |
Opera Android
Full support 45 |
Safari iOS
Full support 11 |
Samsung Internet Android
Full support 8.0 |
Legend
- Full support
- Full support
- No support
- No support
- See implementation notes.'
- See implementation notes.
DOMQuad by Mozilla Contributors is licensed under CC-BY-SA 2.5.