LayoutShiftAttribution

LayoutShiftAttribution interface of the Layout Instability API provides debugging information about elements which have shifted.

特性

LayoutShiftAttribution.Node
Returns the element that has shifted (null if it has been removed).
LayoutShiftAttribution.previousRect
返回 DOMRect representing the position of the element before the shift.
LayoutShiftAttribution.currentRect
返回 DOMRect representing the position of the element after the shift.

规范

规范 状态 Comment
Layout Instability API
The definition of 'LayoutShiftAttribution' 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
LayoutShiftAttribution
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0
currentRect
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0
node
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0
previousRect
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0
toJSON
Chrome 77 Edge 80 Firefox No IE No Opera Yes Safari No WebView Android 77 Chrome Android 77 Firefox Android No Opera Android Yes Safari iOS No Samsung Internet Android 12.0

图例

完整支持
完整支持
不支持
不支持
实验。期望将来行为有所改变。
实验。期望将来行为有所改变。