Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / HTMLScriptElement / script-async-attr.html
blobe89ea5cb7b88c69e76de6ce838aa93bcb875099c
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 </head>
5 <body>
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>
17 <script>
18 description('This test checks for proper parsing of the async attribute on HTML script tags.');
20 var nextScriptID = 9;
22 function isAsync(id)
24 return document.getElementById(id).async;
27 function isDynamicallyInsertedScriptAsync(async)
29 var id = "s" + nextScriptID++;
30 var script = document.createElement("script");
31 script.id = id;
32 script.src = "resources/script-load.js";
33 if (async != null)
34 script.async = async;
35 document.getElementsByTagName("head")[0].appendChild(script);
36 return isAsync(id);
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)");
54 </script>
55 </body>
56 </html>