diff --git a/custom-elements/adopted-callback.html b/custom-elements/adopted-callback.html new file mode 100644 index 00000000000000..2df100301e9821 --- /dev/null +++ b/custom-elements/adopted-callback.html @@ -0,0 +1,135 @@ + + + +Custom Elements: adoptedCallback + + + + + + + + +
+ + + diff --git a/custom-elements/attribute-changed-callback.html b/custom-elements/attribute-changed-callback.html new file mode 100644 index 00000000000000..9bcc9befb1a96e --- /dev/null +++ b/custom-elements/attribute-changed-callback.html @@ -0,0 +1,192 @@ + + + +Custom Elements: attributeChangedCallback + + + + + + + +
+ + + diff --git a/custom-elements/connected-callbacks.html b/custom-elements/connected-callbacks.html new file mode 100644 index 00000000000000..97833db850545d --- /dev/null +++ b/custom-elements/connected-callbacks.html @@ -0,0 +1,88 @@ + + + +Custom Elements: connectedCallback + + + + + + + + +
+ + + diff --git a/custom-elements/disconnected-callbacks.html b/custom-elements/disconnected-callbacks.html new file mode 100644 index 00000000000000..97ea67a8b4ec56 --- /dev/null +++ b/custom-elements/disconnected-callbacks.html @@ -0,0 +1,93 @@ + + + +Custom Elements: disconnectedCallback + + + + + + + + +
+ + + diff --git a/custom-elements/reaction-timing.html b/custom-elements/reaction-timing.html new file mode 100644 index 00000000000000..9e5bafbedfec42 --- /dev/null +++ b/custom-elements/reaction-timing.html @@ -0,0 +1,88 @@ + + + +Custom Elements: Custom element reactions must be invoked before returning to author scripts + + + + + + + +
+ + + diff --git a/custom-elements/resources/document-types.js b/custom-elements/resources/document-types.js new file mode 100644 index 00000000000000..55284d5b132d0a --- /dev/null +++ b/custom-elements/resources/document-types.js @@ -0,0 +1,83 @@ +const DocumentTypes = [ + { + name: 'document', + create: function () { return Promise.resolve(document); }, + isOwner: true, + hasBrowsingContext: true, + }, + { + name: 'document of a template element', + create: function () { + return new Promise(function (resolve) { + var template = document.createElementNS('http://www.w3.org/1999/xhtml', 'template'); + var doc = template.content.ownerDocument; + if (!doc.documentElement) + doc.appendChild(doc.createElement('html')); + resolve(doc); + }); + }, + hasBrowsingContext: false, + }, + { + name: 'new document', + create: function () { + return new Promise(function (resolve) { + var doc = new Document(); + doc.appendChild(doc.createElement('html')); + resolve(doc); + }); + }, + hasBrowsingContext: false, + }, + { + name: 'cloned document', + create: function () { + return new Promise(function (resolve) { + var doc = document.cloneNode(false); + doc.appendChild(doc.createElement('html')); + resolve(doc); + }); + }, + hasBrowsingContext: false, + }, + { + name: 'document created by createHTMLDocument', + create: function () { + return Promise.resolve(document.implementation.createHTMLDocument()); + }, + hasBrowsingContext: false, + }, + { + name: 'HTML document created by createDocument', + create: function () { + return Promise.resolve(document.implementation.createDocument('http://www.w3.org/1999/xhtml', 'html', null)); + }, + hasBrowsingContext: false, + }, + { + name: 'document in an iframe', + create: function () { + return new Promise(function (resolve, reject) { + var iframe = document.createElement('iframe'); + iframe.onload = function () { resolve(iframe.contentDocument); } + iframe.onerror = function () { reject('Failed to load an empty iframe'); } + document.body.appendChild(iframe); + }); + }, + hasBrowsingContext: true, + }, + { + name: 'HTML document fetched by XHR', + create: function () { + return new Promise(function (resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open('GET', 'resources/empty-html-document.html'); + xhr.overrideMimeType('text/xml'); + xhr.onload = function () { resolve(xhr.responseXML); } + xhr.onerror = function () { reject('Failed to fetch the document'); } + xhr.send(); + }); + }, + hasBrowsingContext: false, + } +]; \ No newline at end of file diff --git a/custom-elements/resources/empty-html-document.html b/custom-elements/resources/empty-html-document.html new file mode 100644 index 00000000000000..eaca3f49fd1584 --- /dev/null +++ b/custom-elements/resources/empty-html-document.html @@ -0,0 +1,5 @@ + + + + +