Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(454)

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html

Issue 2032373002: Revert of Implement the script parts of custom element upgrade steps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ce-upgrade-in-document-dom-merge2
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html b/third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html
index c18623cf29dd794cbdee7de66793b6cbb4e4c6d3..f678ca2115442c95bfc4fb6643640d948266462c 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/define-element.html
@@ -87,7 +87,7 @@
let not_a_constructor = () => {};
let invalid_name = 'annotation-xml';
w.customElements.define(invalid_name, not_a_constructor);
- }, 'defining an element with an invalid name and invalid constructor ' +
+ }, 'Defining an element with an invalid name and invalid constructor ' +
'should throw a TypeError for the constructor and not a SyntaxError');
class C extends w.HTMLElement {}
@@ -96,70 +96,7 @@
let invalid_name = 'annotation-xml';
let reused_constructor = C;
w.customElements.define(invalid_name, reused_constructor);
- }, 'defining an element with an invalid name and a reused constructor ' +
+ }, 'Defining an element with an invalid name and a reused constructor ' +
'should throw a SyntaxError for the name and not a NotSupportedError');
}, 'Order of checks');
-
-test_with_window((w) => {
- let doc = w.document;
- doc.body.innerHTML = `
-<a-a id="a">
- <p>
- <a-a id="b"></a-a>
- <a-a id="c"></a-a>
- </p>
- <a-a id="d"></a-a>
-</a-a>`;
- let invocations = [];
- class C extends w.HTMLElement {
- constructor() {
- super();
- console.log(this.getAttribute('id'));
- invocations.push(this);
- }
- }
- w.customElements.define('a-a', C);
- assert_array_equals(['a', 'b', 'c', 'd'], invocations.map((e) => e.id),
- 'four elements should have been upgraded in doc order');
-}, 'Upgrade: existing elements');
-
-test_with_window((w) => {
- let doc = w.document;
- let a = doc.createElement('a-a');
- doc.body.appendChild(a);
- assert_equals(w.HTMLElement.prototype, Object.getPrototypeOf(a),
- 'the undefined autonomous element should be a HTMLElement');
- let invocations = [];
- class C extends w.HTMLElement {
- constructor() {
- super();
- assert_equals(C.prototype, Object.getPrototypeOf(a),
- 'the HTMLElement constructor should set the prototype ' +
- 'to the defined prototype');
- invocations.push(this);
- }
- }
- w.customElements.define('a-a', C);
- assert_array_equals([a], invocations,
- 'the constructor should have been invoked for the in-' +
- 'document element');
-}, 'Upgrade: sets prototype of existing elements');
-
-test_with_window((w) => {
- let doc = w.document;
- var shadow = doc.body.attachShadow({mode: 'open'});
- let a = doc.createElement('a-a');
- shadow.appendChild(a);
- let invocations = [];
- class C extends w.HTMLElement {
- constructor() {
- super();
- invocations.push(this);
- }
- }
- w.customElements.define('a-a', C);
- assert_array_equals([a], invocations,
- 'the constructor should have been invoked once for the ' +
- 'elements in the shadow tree');
-}, 'Upgrade: shadow tree');
</script>

Powered by Google App Engine
This is Rietveld 408576698