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

DOM: CEReactions vs script during insertion #20660

Merged
merged 1 commit into from
Jan 6, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions dom/nodes/Node-appendChild-cereactions-vs-script.window.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const results = [];
test(() => {
class Script1 extends HTMLScriptElement {
constructor() {
super();
}
connectedCallback() {
results.push("ce connected s1");
}
}
class Script2 extends HTMLScriptElement {
constructor() {
super();
}
connectedCallback() {
results.push("ce connected s2");
}
}
customElements.define("script-1", Script1, { extends: "script" });
customElements.define("script-2", Script2, { extends: "script" });
const s1 = new Script1();
s1.textContent = "results.push('s1')";
const s2 = new Script2();
s2.textContent = "results.push('s2')";
document.body.append(s1, s2);
assert_array_equals(results, ["s1", "s2", "ce connected s1", "ce connected s2"]);
}, "Custom element reactions follow script execution");