OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script> |
| 4 description('document.registerElement() in a createdCallback should upgrade elem
ents that are in the same processing queue.'); |
| 5 |
| 6 var createdElements = []; |
| 7 |
| 8 var protoA = Object.create(HTMLElement.prototype); |
| 9 protoA.createdCallback = function () { |
| 10 createdElements.push(this.id); |
| 11 var protoB = Object.create(HTMLElement.prototype); |
| 12 protoB.createdCallback = function () { |
| 13 createdElements.push(this.id); |
| 14 }; |
| 15 |
| 16 document.registerElement('x-b', {prototype: protoB}); |
| 17 shouldBe('createdElements', '["elemA0", "elemB0"]'); |
| 18 }; |
| 19 |
| 20 document.registerElement('x-a', {prototype: protoA}); |
| 21 </script> |
| 22 <x-b id='elemB0'></x-b> |
| 23 <x-a id='elemA0'></x-a> |
| 24 <x-b id='elemB1'></x-b> |
| 25 <script> |
| 26 shouldBe('createdElements', '["elemA0", "elemB0", "elemB1"]'); |
| 27 </script> |
OLD | NEW |