Document:timeline 属性

Baseline 2022

Newly available

Since September 2022, this feature works across the latest devices and browser versions. This feature might not work in older devices or browsers.

Document 接口的 timeline 只读属性表示当前文档的默认时间轴。此时间轴是 DocumentTimeline (en-US) 的一个特殊实例。

此时间轴对于每个文档(document)来说都是唯一的,并在文档的生命周期中持续存在,包括调用了 Document.open() 的情况。

此时间轴以毫秒为单位表示自 Performance.timeOrigin 以来经过的时间。在时间原点(time origin)之前,时间轴为非活动状态,它的 currentTime (en-US) 值为 null

备注: 与非活动文档(未与 Window<iframe><frame> 关联的 Document)关联的文档时间轴也被认为是非活动的。

一个 DocumentTimeline (en-US) 对象。

规范

Specification
Web Animations
# dom-document-timeline

浏览器兼容性

BCD tables only load in the browser

参见