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

Unified 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: delete unnecessary console.log 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/create-element-inside-template.html
diff --git a/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.html b/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.html
index 89bd75c3ccfec5e8144d92cce66016fbcef2d0e4..d43c2eb09e3a38c1cdbf09b110e3df36b0e43358 100644
--- a/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.html
+++ b/third_party/WebKit/LayoutTests/custom-elements/spec/create-element-inside-template.html
@@ -8,15 +8,24 @@
<script>
'use strict';
-// Setup iframe to test the parser.
-iframe.srcdoc = `<template id="test"><a-a>innerHTML</a-a></template>`;
+iframe.srcdoc = `<template id="test"><a-a></a-a></template>`;
setup({ explicit_done: true });
iframe.onload = () => {
+ let logs = [];
let doc = iframe.contentDocument;
+ let w = doc.defaultView;
let tmpl = doc.querySelector('#test');
let element = tmpl.content.querySelector('a-a');
+ console.log(element + '');
kojii 2016/09/06 08:10:55 Please remove this one too.
+ w.customElements.define('a-a', class extends w.HTMLElement {
+ constructor() { super(); logs.push('construct'); }
+ connectedCallback() { logs.push('connected'); }
+ }
+ );
test(function () {
- assert_false(element.matches(':defined'));
+ assert_true(element.matches(':not(:defined)'));
+ assert_true(element instanceof w.HTMLElement);
+ logs.push('test');
}, 'Custom element state in template content should be "not defined"');
done();
};

Powered by Google App Engine
This is Rietveld 408576698