mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-10 02:08:38 +09:00
parent
31b26a24e3
commit
cedff6e214
28 changed files with 82 additions and 879 deletions
|
|
@ -18,23 +18,19 @@ SimpleTest.waitForExplicitFinish();
|
|||
|
||||
var connectedCallbackCount = 0;
|
||||
|
||||
var p = Object.create(HTMLElement.prototype);
|
||||
|
||||
p.createdCallback = function() {
|
||||
ok(true, "createdCallback called.");
|
||||
class Foo extends HTMLElement {
|
||||
connectedCallback() {
|
||||
ok(true, "connectedCallback should be called when the parser creates an element in the document.");
|
||||
connectedCallbackCount++;
|
||||
// connectedCallback should be called twice, once for the element created for innerHTML and
|
||||
// once for the element created in this document.
|
||||
if (connectedCallbackCount == 2) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
p.connectedCallback = function() {
|
||||
ok(true, "connectedCallback should be called when the parser creates an element in the document.");
|
||||
connectedCallbackCount++;
|
||||
// connectedCallback should be called twice, once for the element created for innerHTML and
|
||||
// once for the element created in this document.
|
||||
if (connectedCallbackCount == 2) {
|
||||
SimpleTest.finish();
|
||||
}
|
||||
}
|
||||
|
||||
document.registerElement("x-foo", { prototype: p });
|
||||
customElements.define("x-foo", Foo);
|
||||
|
||||
var container = document.getElementById("container");
|
||||
container.innerHTML = '<x-foo></x-foo>';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue