Thu, 22 Jan 2015 13:21:57 +0100
Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6
michael@0 | 1 | <!DOCTYPE HTML> |
michael@0 | 2 | <html> |
michael@0 | 3 | <!-- |
michael@0 | 4 | https://bugzilla.mozilla.org/show_bug.cgi?id=28293 |
michael@0 | 5 | --> |
michael@0 | 6 | <head> |
michael@0 | 7 | <title>Test for Bug 28293</title> |
michael@0 | 8 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 9 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 10 | <script> |
michael@0 | 11 | scriptInsertedExternalExecuted = false; |
michael@0 | 12 | res = 'A'; |
michael@0 | 13 | |
michael@0 | 14 | SimpleTest.waitForExplicitFinish(); |
michael@0 | 15 | onload = function () { |
michael@0 | 16 | |
michael@0 | 17 | res+='2'; |
michael@0 | 18 | |
michael@0 | 19 | s = document.createElement('script'); |
michael@0 | 20 | s.textContent="res+='g';"; |
michael@0 | 21 | s.defer = true; |
michael@0 | 22 | document.body.appendChild(s); |
michael@0 | 23 | |
michael@0 | 24 | res+='3'; |
michael@0 | 25 | |
michael@0 | 26 | s = document.createElement('script'); |
michael@0 | 27 | s.textContent="res+='i';done()"; |
michael@0 | 28 | s.defer = true; |
michael@0 | 29 | document.body.appendChild(s); |
michael@0 | 30 | |
michael@0 | 31 | res+='4'; |
michael@0 | 32 | } |
michael@0 | 33 | |
michael@0 | 34 | function done() { |
michael@0 | 35 | is(res, "AacBCDEFGeHIJb1M2g3i", "scripts executed in the wrong order"); |
michael@0 | 36 | ok(scriptInsertedExternalExecuted, "Dynamic script did not block load"); |
michael@0 | 37 | SimpleTest.finish(); |
michael@0 | 38 | } |
michael@0 | 39 | </script> |
michael@0 | 40 | </head> |
michael@0 | 41 | <body> |
michael@0 | 42 | <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=28293">Mozilla Bug 28293</a> |
michael@0 | 43 | |
michael@0 | 44 | <script defer> |
michael@0 | 45 | res += 'a'; |
michael@0 | 46 | </script> |
michael@0 | 47 | <script defer src="data:text/plain,res+='b'"></script> |
michael@0 | 48 | <script defer> |
michael@0 | 49 | res += 'c'; |
michael@0 | 50 | </script> |
michael@0 | 51 | <script> |
michael@0 | 52 | res += 'B'; |
michael@0 | 53 | </script> |
michael@0 | 54 | <script> |
michael@0 | 55 | res += 'C'; |
michael@0 | 56 | |
michael@0 | 57 | s = document.createElement('script'); |
michael@0 | 58 | s.textContent="res+='D';"; |
michael@0 | 59 | document.body.appendChild(s); |
michael@0 | 60 | |
michael@0 | 61 | res += 'E'; |
michael@0 | 62 | </script> |
michael@0 | 63 | <script> |
michael@0 | 64 | res += 'F'; |
michael@0 | 65 | document.addEventListener("DOMContentLoaded", function() { |
michael@0 | 66 | res += '1' |
michael@0 | 67 | s = document.createElement('script'); |
michael@0 | 68 | s.src="file_bug28293.sjs?res+='M';"; |
michael@0 | 69 | document.body.appendChild(s); |
michael@0 | 70 | }, false); |
michael@0 | 71 | res += 'G'; |
michael@0 | 72 | </script> |
michael@0 | 73 | <script defer> |
michael@0 | 74 | res += 'e'; |
michael@0 | 75 | </script> |
michael@0 | 76 | <script src="file_bug28293.sjs?res+='H';"></script> |
michael@0 | 77 | <script> |
michael@0 | 78 | res += 'I'; |
michael@0 | 79 | s = document.createElement('script'); |
michael@0 | 80 | s.src="file_bug28293.sjs?scriptInsertedExternalExecuted=true;"; |
michael@0 | 81 | document.body.appendChild(s); |
michael@0 | 82 | res += 'J'; |
michael@0 | 83 | </script> |
michael@0 | 84 | |
michael@0 | 85 | </body> |
michael@0 | 86 | </html> |