1

在过去的一周左右,我用来if (foo instanceof ClientRect)捕捉特定用户交互的 UI 原型项目停止工作并开始抛出Uncaught ReferenceError: ClientRect is not defined. 我的本地版本停止工作,但自 4 月以来尚未更新且运行良好的在线版本也是如此。

不知何故,该项目仅适用于 Opera 45.0 版。将其更新到 48.0 后,它也停止了在 Opera 上的工作。

是否发生了一些可能导致这种行为的更新?

4

1 回答 1

3

DOMRect是您正在寻找的标准。ClientRect是遗产:

https://bugs.chromium.org/p/chromium/issues/detail?id=719246

查看更多DOMRect

https://developer.mozilla.org/en-US/docs/Web/API/Element/getBoundingClientRect https://developer.mozilla.org/en-US/docs/Web/API/DOMRect

于 2020-12-30T02:15:11.443 回答