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

Side by Side Diff: third_party/WebKit/LayoutTests/custom-elements/imports/resources/inner-html.html

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: resolve most comments 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
OLDNEW
(Empty)
1 <div id="sandbox"></div>
2 <script>
3 'use strict';
4
5 let constructors = [];
6
7 test(() => {
8 assert_equals(constructors.length, 0);
9
10 customElements.define('a-a', class extends HTMLElement {
11 constructor() {
12 super();
13 constructors.push(this);
14 }
15 });
16
17 let importDoc = document.currentScript.ownerDocument;
18 let sandbox = importDoc.querySelector('#sandbox');
19
20 // createElement should synchronously customize.
21 sandbox.innerHTML = '<a-a id="x"></a-a>';
22
23 assert_equals(constructors.length, 1);
24 assert_equals(constructors[0].id, 'x');
25 }, 'innerHTML with Custom Elements should work in imported document.');
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698