Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / dom / Document / document-current-script.html
blobe67deecb7ad05f37495f1f66912de960c724a40a
1 <!DOCTYPE html>
2 <body>
3 <script src="../../../resources/js-test.js"></script>
4 <script>
6 jsTestIsAsync = true;
8 description('Test basic usage of document.currentScript')
10 function logCurrentScript() {
11 var script = document.currentScript
12 var s = '&lt;script id="' + script.id + '"';
13 if (script.src)
14 s += ' src="..."';
15 if (script.defer)
16 s += ' defer';
17 if (script.async)
18 s += ' async';
19 s += '>';
20 debug(s);
23 </script>
24 <script id="a">
25 logCurrentScript();
26 </script>
27 <script id="b">
28 logCurrentScript();
29 </script>
30 <script id="c">
31 logCurrentScript();
32 document.write('<script id="d">logCurrentScript();<\/script>');
33 logCurrentScript();
34 </script>
36 <script id="defer-1" defer src="resources/log-current-script.js"></script>
37 <script id="e" src="resources/log-current-script.js"></script>
40 <script id="f">
41 logCurrentScript();
42 document.write('<script id="g" src="resources/log-current-script.js"><\/script>');
43 logCurrentScript();
44 </script>
46 <script id="h">
47 logCurrentScript();
48 document.write('<script id="defer-2" defer src="resources/log-current-script.js"><\/script>');
49 logCurrentScript();
50 </script>
52 <script id="i">
53 logCurrentScript();
55 var script = document.createElement('script');
56 script.id = 'j';
57 script.textContent = 'logCurrentScript();';
58 script.async = false;
59 script.defer = false;
60 document.head.appendChild(script);
62 logCurrentScript();
63 </script>
65 <script>
66 window.onload = function() {
67 shouldBeNull('document.currentScript');
68 finishJSTest();
70 </script>
71 </body>
72 </html>