DOMQuad

这是 实验性技术
检查 浏览器兼容性表格 在生产中使用这之前。

A DOMQuad is a collection of four DOMPoint s defining the corners of an arbitrary quadrilateral. Returning DOMQuad s 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.

构造函数

DOMQuad.DOMQuad()
创建新的 DOMQuad 对象。

特性

p1,p2,p3,p4 只读
are DOMPoint objects for each of the DOMQuad object's four corners.

方法

DOMQuad.fromRect()
返回新 DOMQuad object based on the passed set of coordinates.
DOMQuad.fromQuad()
返回新 DOMQuad object based on the passed set of coordinates.
DOMQuad.getBounds()
返回 DOMRect object with the coordinates and dimensions of the DOMQuad 对象。
DOMQuad.toJSON()
Returns a JSON representation of the DOMQuad 对象。

规范

规范 状态 Comment
Geometry Interfaces Module Level 1
The definition of 'DOMQuad' in that specification.
候选推荐 初始定义。

浏览器兼容性

更新 GitHub 上的兼容性数据
Desktop Mobile
Chrome Edge Firefox Internet Explorer Opera Safari Android webview Chrome for Android Firefox for Android Opera for Android Safari on iOS Samsung Internet
DOMQuad Chrome 61 Edge 79 Firefox 31 IE 不支持 No Opera 48 Safari 11 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 11 Samsung Internet Android 8.0
DOMQuad() 构造函数 Chrome 61 Edge 79 Firefox 31 IE 不支持 No Opera 48 Safari 11 WebView Android 61 Chrome Android 61 Firefox Android 31 Opera Android 45 Safari iOS 11 Samsung Internet Android 8.0
fromQuad() static function Chrome Yes Edge 79 Firefox 69 IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 不支持 No Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
fromRect() static function Chrome Yes Edge 79 Firefox 69 IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 不支持 No Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
getBounds() Chrome Yes Edge 79 Firefox 62 IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 62 Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
p1 Chrome Yes Edge 79 Firefox 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
p2 Chrome Yes Edge 79 Firefox 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
p3 Chrome Yes Edge 79 Firefox 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
p4 Chrome Yes Edge 79 Firefox 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
IE 不支持 No Opera Yes Safari Yes WebView Android Yes Chrome Android Yes Firefox Android 31
注意事项
31
注意事项
Prior to Firefox 69, the default value of p1 through p4 was undefined; now DOMQuadInit defines these as false .
Opera Android Yes Safari iOS Yes Samsung Internet Android Yes
toJSON() Chrome Yes Edge 79 Firefox 62 IE 不支持 No Opera Yes Safari 11 WebView Android Yes Chrome Android Yes Firefox Android 62 Opera Android Yes Safari iOS 11 Samsung Internet Android Yes
Available in workers Chrome 61 Edge 79 Firefox 69 IE 不支持 No Opera 48 Safari 11 WebView Android 61 Chrome Android 61 Firefox Android 不支持 No Opera Android 45 Safari iOS 11 Samsung Internet Android 8.0

图例

完整支持
完整支持
不支持
不支持
见实现注意事项。
  1. DOMQuad
  2. Related pages for Geometry Interfaces
    1. CSSMatrix
    2. DOMMatrix
    3. DOMMatrixReadOnly
    4. Point