-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should the Window named properties object return supported named properties in [[OwnPropertyKeys]]? #9068
Comments
web-platform-tests/wpt#36746 was recently opened and seems related.
No, just the order. The behavior is given by the ordinary non-exotic [[OwnPropertyKeys]], for which ES262 says is "in ascending chronological order of property creation". So the quoted part of Web IDL is saying that the exact order in which properties are created for platform objects is not defined. I guess this is somewhat of a lie, because https://webidl.spec.whatwg.org/#interface-prototype-object step 11-12 has a sort of order: attributes, operations, iteration methods, async iteration methods, constants. But within those categories ordering is not defined. And this ordering is unintentional and wasn't thought through. whatwg/webidl#432 is the canonical issue for discussing this.
No. Blink and WebKit are correct. The named properties object uses OrdinaryOwnPropertyKeys, which iterates over the property keys of the object. But there are no property keys of the named properties object; instead it has custom behavior in its [[GetOwnProperty]] handler. web-platform-tests/wpt#36746 discusses this in detail. |
Thanks! Do you think it would be helpful if I added a note clarifying that named properties objects don’t have any real properties, so its ordinary [[OwnPropertyKeys]] won’t return any supported named properties, and a note clarifying that Window’s named properties use the rules for named properties objects rather than legacy platform objects? |
Yes, I think that'd definitely be helpful.
Yeah, adding something like that around https://html.spec.whatwg.org/multipage/nav-history-apis.html#named-access-on-the-window-object would make sense to me. |
Done in #9080 and whatwg/webidl#1285 :) |
Given
data:text/html,<iframe name=123>
withReflect.ownKeys(window.__proto__.__proto__)
…This seems to be why Firefox fails the [[OwnPropertyKeys]] subtest of /webidl/ecmascript-binding/window-named-properties-object.html, but I can’t figure out what the correct behaviour is according to the spec. This is how far I got:
Have I missed something? Does this mean both Gecko and Blink and WebKit are correct?
(cc @domenic, on behalf of servo/servo#29396)
The text was updated successfully, but these errors were encountered: