OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/js-test.js"></script> | 2 <script src="../../../resources/js-test.js"></script> |
3 <div id="container"></div> | 3 <div id="container"></div> |
4 <script> | 4 <script> |
5 description('Tests that custom element constructors run the createdCallback sync
hronously.'); | 5 description('Tests that custom element constructors run the createdCallback sync
hronously.'); |
6 | 6 |
7 var proto = Object.create(HTMLElement.prototype); | 7 var proto = Object.create(HTMLElement.prototype); |
8 var ncallbacks = 0; | 8 var ncallbacks = 0; |
9 proto.createdCallback = function () { | 9 proto.createdCallback = function () { |
10 ncallbacks++; | 10 ncallbacks++; |
11 }; | 11 }; |
12 var A = document.register('x-a', {prototype: proto}); | 12 var A = document.registerElement('x-a', {prototype: proto}); |
13 var x = new A(); | 13 var x = new A(); |
14 shouldBe('ncallbacks', '1'); | 14 shouldBe('ncallbacks', '1'); |
15 | 15 |
16 successfullyParsed = true; | 16 successfullyParsed = true; |
17 </script> | 17 </script> |
OLD | NEW |