[whatwg/webidl] Replaceable attribute `window.performance` (Issue #1193)

https://webidl.spec.whatwg.org/#Replaceable defines that a replaceable attribute should be an IDL attribute (accessor pair defined on the prototype instead of the instance objects), whilst it can be replaced with shadowing the prototype accessor when setting the corresponding property on the platform object, like the https://webidl.spec.whatwg.org/#example-fe2bdbf4 shows.

[`window.performance`](https://www.w3.org/TR/hr-time-3/#the-performance-attribute) is defined as a replaceable attribute on WindowOrWorkerGlobalScope. Major browser implementations (Chrome, Safari, Firefox) seem to be diverging from the definition of a replaceable attribute:

```js
window. hasOwnProperty('performance'); // => true, should be false according to the definition.
Object.getPrototypeOf(window).hasOwnProperty('performance'); // => false, should be true
```

Is this an implementation bug, or should we update the spec to reflect what the reality is?

Refs: https://github.com/nodejs/node/pull/44483#discussion_r961088430

-- 
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/webidl/issues/1193
You are receiving this because you are subscribed to this thread.

Message ID: <whatwg/webidl/issues/1193@github.com>

Received on Sunday, 18 September 2022 16:04:52 UTC