Skip to content
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

"On setting, if the new value is null then the c..." #3351

Closed
cdumez opened this issue Jan 14, 2018 · 2 comments
Closed

"On setting, if the new value is null then the c..." #3351

cdumez opened this issue Jan 14, 2018 · 2 comments

Comments

@cdumez
Copy link

cdumez commented Jan 14, 2018

https://html.spec.whatwg.org/#navigating-auxiliary-browsing-contexts-in-the-dom:disowned-its-opener

On setting, if the new value is null then the current browsing context must disown its opener; if the new value is anything else then the user agent must call the [[DefineOwnProperty]] internal method of the Window object, passing the property name "opener" as the property key, and the Property Descriptor { [[Value]]:​ value, [[Writable]]:​ true, [[Enumerable]]:​ true, [[Configurable]]:​ true } as the property descriptor, where value is the new value.

Consider the case:
// window.opener returns a [Window]
window.opener = "foo"
// window.opener returns "foo"
window.opener = null;
// This disowns the opener as per the specification
// Should window.opener return null or "foo"?

My interpretation of the specification is that we should return "foo". This is because we disown the opener but do not call [DefineOwnProperty] because [DefineOwnProperty] is only called if the value is anything else than null.

However, quick testing in Firefox and Chrome seems to indicate they return null.

@cdumez
Copy link
Author

cdumez commented Jan 14, 2018

cc @domenic

@cdumez
Copy link
Author

cdumez commented Jan 14, 2018

Actually, upon further testing, I may be mistaken. When setting the value to "foo" in the first place, it calls [DefineOwnProperty]. So when you set it to null the second time, it appears to updates the descriptor's value to null but does not actually disown the opener.

@cdumez cdumez closed this as completed Jan 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant