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

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: 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..c370c1b574c80f6a82eab9ea009fb79b840212c0 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,7 +21,7 @@ test_with_window(w => {
throw new Error();
}
connectedCallback() {
- assert_unreached('connectedCallback should not be invoked if constructor threw');
+ assert_unreached('connectedCallback should not be invoked if constructor threw');
}
});
@@ -36,6 +36,13 @@ 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