| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script src="../../js/resources/js-test-pre.js"></script> | 4 <script src="../../js/resources/js-test-pre.js"></script> |
| 5 <script> | 5 <script> |
| 6 description("This test ensures that the lifecycle callbacks of API-originated el
ements are visible in following script block.") | 6 description("This test ensures that the lifecycle callbacks of API-originated el
ements are visible in following script block.") |
| 7 window.callbacksCalled = []; | 7 window.callbacksCalled = []; |
| 8 function markingReadyCallback() { | 8 function markingReadyCallback() { |
| 9 window.callbacksCalled.push(this.tagName); | 9 window.callbacksCalled.push(this.tagName); |
| 10 this.callbacksCalled = true; | 10 this.callbacksCalled = true; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 shouldBeTrue("importedFoo.callbacksCalled"); | 46 shouldBeTrue("importedFoo.callbacksCalled"); |
| 47 shouldBeTrue("importedFoo.firstChild.callbacksCalled"); | 47 shouldBeTrue("importedFoo.firstChild.callbacksCalled"); |
| 48 | 48 |
| 49 window.callbacksCalled = []; | 49 window.callbacksCalled = []; |
| 50 var foreignBar = foreignDoc.createElement('div', 'x-bar'); | 50 var foreignBar = foreignDoc.createElement('div', 'x-bar'); |
| 51 foreignBar.appendChild(foreignDoc.createElement('x-foo')); | 51 foreignBar.appendChild(foreignDoc.createElement('x-foo')); |
| 52 shouldBe("window.callbacksCalled", "[]"); | 52 shouldBe("window.callbacksCalled", "[]"); |
| 53 importedBar = document.importNode(foreignBar); | 53 importedBar = document.importNode(foreignBar); |
| 54 shouldBeTrue("importedBar.callbacksCalled"); | 54 shouldBeTrue("importedBar.callbacksCalled"); |
| 55 shouldBeTrue("importedBar.firstChild.callbacksCalled"); | 55 shouldBeTrue("importedBar.firstChild.callbacksCalled"); |
| 56 shouldBe("window.callbacksCalled", "['DIV', 'X-FOO']"); | 56 shouldBe("window.callbacksCalled", "['X-FOO', 'DIV']"); |
| 57 | 57 |
| 58 window.callbacksCalled = []; | 58 window.callbacksCalled = []; |
| 59 var toBeReplaced = document.createElement("div"); | 59 var toBeReplaced = document.createElement("div"); |
| 60 document.body.appendChild(toBeReplaced); | 60 document.body.appendChild(toBeReplaced); |
| 61 toBeReplaced.outerHTML = "<x-foo></x-foo>"; | 61 toBeReplaced.outerHTML = "<x-foo></x-foo>"; |
| 62 shouldBe("window.callbacksCalled", "['X-FOO']"); | 62 shouldBe("window.callbacksCalled", "['X-FOO']"); |
| 63 | 63 |
| 64 window.callbacksCalled = []; | 64 window.callbacksCalled = []; |
| 65 var insertionPlaceHolder = document.createElement("div"); | 65 var insertionPlaceHolder = document.createElement("div"); |
| 66 document.body.appendChild(insertionPlaceHolder); | 66 document.body.appendChild(insertionPlaceHolder); |
| 67 insertionPlaceHolder.insertAdjacentHTML("beforebegin", "<x-foo></x-foo>"); | 67 insertionPlaceHolder.insertAdjacentHTML("beforebegin", "<x-foo></x-foo>"); |
| 68 shouldBe("window.callbacksCalled", "['X-FOO']"); | 68 shouldBe("window.callbacksCalled", "['X-FOO']"); |
| 69 | 69 |
| 70 </script> | 70 </script> |
| 71 <script src="../../js/resources/js-test-post.js"></script> | 71 <script src="../../js/resources/js-test-post.js"></script> |
| 72 </body> | 72 </body> |
| 73 </html> | 73 </html> |
| OLD | NEW |