OLD | NEW |
(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> |
OLD | NEW |