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

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

Issue 2589383002: Do not push the custom element construction stack in some cases. (Closed)
Patch Set: Remove redundant scope and rebase. Created 4 years 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/imported/wpt/custom-elements/parser/parser-uses-constructed-element-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/custom-elements/spec/construct.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html b/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html
index 4d33bb67af06833951a209564bce7701386b520a..4bae58660fdde158d4eb8bd91e59260d09da23be 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/construct.html
@@ -122,11 +122,31 @@ test_with_window((w) => {
}
}
w.customElements.define('a-a', A);
+ let e = w.document.createElement('a-a');
+ assert_true(e.matches(':defined'),
+ 'constructing an autonomous custom element with create element should ' +
+ 'not throw InvalidStateError ' +
+ 'and should return a "custom" element');
+}, 'Already constructed marker, create element');
+
+test_with_window((w) => {
+ let flag = true;
+ class A extends w.HTMLElement {
+ constructor() {
+ if (flag) {
+ flag = false;
+ new A();
+ }
+ super();
+ }
+ }
+ w.customElements.define('a-a', A);
+ let d = w.document.createElement('div');
assert_reports(w, 'INVALID_STATE_ERR', () => {
- w.document.createElement('a-a');
+ d.innerHTML = '<a-a>';
}, 'Creating an element that is already constructed marker should report ' +
'InvalidStateError');
-}, 'Already constructed marker, create element');
+}, 'Already constructed marker, fragment parsing should set marker');
test_with_window((w) => {
let errors = [];
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/imported/wpt/custom-elements/parser/parser-uses-constructed-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698