此页面由社区从英文翻译而来。了解更多并加入 MDN Web Docs 社区。

View in English Always switch to English

Document:timeline 属性

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since ⁨2020年7月⁩.

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

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

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

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