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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-create.html

Issue 2173623003: Add "Failed" custom element state (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Avoid multiple toElement Created 4 years, 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <title>Custom Elements: Custom Element State "Failed" in document parser</title>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <script src="resources/custom-elements-helpers.js"></script>
6 <body>
7 <template id="test-content">
8 <script>
9 'use strict';
10 window.logs = [];
11 customElements.define('a-a', class extends HTMLElement {
12 constructor() {
13 super();
14 logs.push('constructor');
15 throw new Error();
16 }
17 connectedCallback() {
18 logs.push('connected');
19 }
20 });
21 </script>
22 <a-a></a-a>
23 </template>
24 <script>
25 'use strict';
26
27 // Custom Element State
28 // https://dom.spec.whatwg.org/#concept-element-custom-element-state
29 // Set to "failed" in step 7 of "create an element for a token"
30 // https://html.spec.whatwg.org/multipage/syntax.html#create-an-element-for-the- token
31
32 // This test loads the template content into iframe.srcdoc because "create an
33 // element for a token" with synchronous custom elements flag set to true is
34 // used only in document parser.
35
36 test_with_window(w => {
37 let logs = w.logs;
38 assert_equals(logs.length, 1, 'Only constructor should be invoked');
39 assert_equals(logs[0], 'constructor', 'The 1st action should be constructor');
40 }, undefined, document.getElementById('test-content').innerHTML);
41 </script>
42 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698