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

Unified Diff: third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html

Issue 2313573002: Custom Elements: add prototype check for "failed" elements (Closed)
Patch Set: template.html clean up Created 4 years, 3 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/state-failed-upgrade.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html b/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html
index 995ee272ea2a87d5ddfcf3a51a08282c01718bd2..fff117f7b99ae8ba6e90bcedcaa0faa57e1e16cf 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-upgrade.html
@@ -21,6 +21,8 @@ test_with_window(w => {
throw new Error();
}
connectedCallback() {
+ // TODO(davaajav): remove the failure expectation when this issue is closed
+ // https://github.com/w3c/webcomponents/issues/563
assert_unreached('connectedCallback should not be invoked if constructor threw');
}
});
@@ -36,6 +38,15 @@ test_with_window(w => {
// "failed" is not "defined"
// https://dom.spec.whatwg.org/#concept-element-defined
assert_false(element.matches(':defined'));
+
+ // "failed" element should implement HTMLUnknownElement only in "creating an element for a token"
+ // https://html.spec.whatwg.org/#create-an-element-for-the-token
+ assert_equals(Object.getPrototypeOf(element), w.HTMLElement.prototype);
+
+ // 2. If element's custom element state is "failed", then abort these steps.
+ // https://html.spec.whatwg.org/multipage/scripting.html#upgrades
+ container.appendChild(element);
+ assert_equals(constructorCount, 1, 'constructor should be invoked once');
});
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698