-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Test that window.customElements is per global, not per-document #5681
Conversation
Notifying @alsemenov, @deepak-sa, @dominiccooney, @hayatoito, @kojiishi, @rniwa, @sgrekhov, and @TakayoshiKochi. (Learn how reviewing works.) |
LintPassed |
Firefox (nightly channel)Testing web-platform-tests at revision d547f34 All results1 test ran/custom-elements/custom-element-registry/per-global.html
|
Chrome (unstable channel)Testing web-platform-tests at revision d547f34 All results1 test ran/custom-elements/custom-element-registry/per-global.html
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is great. Love the abstraction. I'm curious though whether Chrome and Safari can implement this or have some kind of architectural objection to it given that nothing seems tied to the lifetime of the Window object there now.
|
||
const after = frame[propertyName]; | ||
assert_equals(after, before); | ||
t.done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use step_func_done?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cannot be used here because we don't want to be done if the location is about:blank. I'll add a comment.
common/object-association.js
Outdated
|
||
const after = frame[propertyName]; | ||
assert_not_equals(after, before); | ||
t.done(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here.
|
||
iframe.src = "/common/blank.html"; | ||
document.body.appendChild(iframe); | ||
}, `document.open() must replace window.${propertyName}`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is disputed: whatwg/html#1698. Not sure if we should test it. We should maybe call this out as an open issue in the HTML Standard.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My take is that even if we change the spec there we'll still want to reset all the per-Window objects. I'll comment there.
<link rel="author" title="Domenic Denicola" href="mailto:d@domenic.me"> | ||
<script src="/common/object-association.js"></script> | ||
|
||
<iframe id="blank-iframe"></iframe> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems you can remove this. Meaning this could in fact be a .window.js though that would remove some metadata so up to you.
Let's merge this and file bugs, and if people object we can reopen discussion. It seems like the right way to get the conversation started. |
See whatwg/html#2578.
/cc @rniwa @dominiccooney
This change is