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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.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 unified diff | Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-create.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <title>Custom Elements: create an element inside a template </title> 2 <title>Custom Elements: create an element inside a template </title>
3 <link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element"> 3 <link rel="help" href="https://dom.spec.whatwg.org/#concept-create-element">
4 <script src="../../resources/testharness.js"></script> 4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script> 5 <script src="../../resources/testharnessreport.js"></script>
6 <script src="resources/custom-elements-helpers.js"></script> 6 <script src="resources/custom-elements-helpers.js"></script>
7 <iframe id="iframe"></iframe> 7 <iframe id="iframe"></iframe>
8 <script> 8 <script>
9 'use strict'; 9 'use strict';
10 10
11 // Setup iframe to test the parser. 11 iframe.srcdoc = `<template id="test"><a-a></a-a></template>`;
12 iframe.srcdoc = `<template id="test"><a-a>innerHTML</a-a></template>`;
13 setup({ explicit_done: true }); 12 setup({ explicit_done: true });
14 iframe.onload = () => { 13 iframe.onload = () => {
15 let doc = iframe.contentDocument; 14 let doc = iframe.contentDocument;
15 let w = doc.defaultView;
16 let tmpl = doc.querySelector('#test'); 16 let tmpl = doc.querySelector('#test');
17 let element = tmpl.content.querySelector('a-a'); 17 let element = tmpl.content.querySelector('a-a');
18 w.customElements.define('a-a', class extends w.HTMLElement {});
18 test(function () { 19 test(function () {
19 assert_false(element.matches(':defined')); 20 assert_true(element.matches(':not(:defined)'));
21 assert_equals(Object.getPrototypeOf(element), w.HTMLElement.prototype);
kojii 2016/09/06 04:58:51 I'm not sure what is the good way to test "impleme
20 }, 'Custom element state in template content should be "not defined"'); 22 }, 'Custom element state in template content should be "not defined"');
21 done(); 23 done();
22 }; 24 };
23 </script> 25 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/custom-elements/spec/state-failed-create.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698