| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <script src="../../js/resources/js-test-pre.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 the element upgrade algorithm.'); | 5 description('Tests the element upgrade algorithm.'); |
| 6 | 6 |
| 7 // "Element Upgrade" is the processing of custom elements which were | 7 // "Element Upgrade" is the processing of custom elements which were |
| 8 // created before their definition was available, when the definition | 8 // created before their definition was available, when the definition |
| 9 // becomes available. The following scenarios cover a lot but are not | 9 // becomes available. The following scenarios cover a lot but are not |
| 10 // exhaustive. | 10 // exhaustive. |
| 11 | 11 |
| 12 // Scenario A: Custom tag; upgrade candidate is not in the document; | 12 // Scenario A: Custom tag; upgrade candidate is not in the document; |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 // Use a good number of elements to avoid false positives from random correct or
dering. | 49 // Use a good number of elements to avoid false positives from random correct or
dering. |
| 50 host.innerHTML = '<x-e id="e1"><x-e id="e2"></x-e></x-e><x-e id="e3"></x-e><x-e
id="e4"></x-e><x-e id="e5"></x-e>'; | 50 host.innerHTML = '<x-e id="e1"><x-e id="e2"></x-e></x-e><x-e id="e3"></x-e><x-e
id="e4"></x-e><x-e id="e5"></x-e>'; |
| 51 var upgradedOrder = []; | 51 var upgradedOrder = []; |
| 52 var protoE = Object.create(HTMLElement.prototype); | 52 var protoE = Object.create(HTMLElement.prototype); |
| 53 protoE.createdCallback = function() { upgradedOrder.push(this.id); }; | 53 protoE.createdCallback = function() { upgradedOrder.push(this.id); }; |
| 54 document.register('x-e', {prototype: protoE}); | 54 document.register('x-e', {prototype: protoE}); |
| 55 shouldBe('upgradedOrder', '["e2","e1","e3","e4","e5"]'); | 55 shouldBe('upgradedOrder', '["e2","e1","e3","e4","e5"]'); |
| 56 | 56 |
| 57 successfullyParsed = true; | 57 successfullyParsed = true; |
| 58 </script> | 58 </script> |
| OLD | NEW |