3 <script src=
"../../../resources/js-test.js"></script>
7 <script id=
"s0" src=
"ignored.js"></script>
8 <script id=
"s1" src=
"ignored.js" async
></script>
9 <script id=
"s2" src=
"ignored.js" async=
"async"></script>
10 <script id=
"s3" src=
"ignored.js" async=
"ASYNC"></script>
11 <script id=
"s4" src=
"ignored.js" async=
"true"></script>
12 <script id=
"s5" src=
"ignored.js" async=
"false"></script>
13 <script id=
"s6"></script>
14 <script id=
"s7" async
></script>
15 <script id=
"s8" async
></script>
18 description('This test checks for proper parsing of the async attribute on HTML script tags.');
24 return document
.getElementById(id
).async
;
27 function isDynamicallyInsertedScriptAsync(async
)
29 var id
= "s" + nextScriptID
++;
30 var script
= document
.createElement("script");
32 script
.src
= "resources/script-load.js";
35 document
.getElementsByTagName("head")[0].appendChild(script
);
39 document
.getElementById("s8").removeAttribute("async");
41 shouldBeFalse("isAsync('s0')");
42 shouldBeTrue("isAsync('s1')");
43 shouldBeTrue("isAsync('s2')");
44 shouldBeTrue("isAsync('s3')");
45 shouldBeTrue("isAsync('s4')");
46 shouldBeTrue("isAsync('s5')");
47 shouldBeTrue("isAsync('s6')");
48 shouldBeTrue("isAsync('s7')");
49 shouldBeFalse("isAsync('s8')");
50 shouldBeTrue("isDynamicallyInsertedScriptAsync(true)");
51 shouldBeFalse("isDynamicallyInsertedScriptAsync(false)");
52 shouldBeTrue("isDynamicallyInsertedScriptAsync(\"async\")");
53 shouldBeTrue("isDynamicallyInsertedScriptAsync(null)");