OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <title>event and htmlFor IDL attributes of HTMLScriptElement</title> | 2 <title>event and htmlFor IDL attributes of HTMLScriptElement</title> |
3 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> | 3 <link rel="author" title="Ms2ger" href="mailto:ms2ger@gmail.com"> |
4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-event"
> | 4 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-event"
> |
5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-htmlfo
r"> | 5 <link rel="help" href="https://html.spec.whatwg.org/multipage/#dom-script-htmlfo
r"> |
6 <script src="../../../../../../resources/testharness.js"></script> | 6 <script src="../../../../../../resources/testharness.js"></script> |
7 <script src="../../../../../../resources/testharnessreport.js"></script> | 7 <script src="../../../../../../resources/testharnessreport.js"></script> |
8 <div id="log"></div> | 8 <div id="log"></div> |
9 <script> | 9 <script> |
10 test(function() { | 10 test(function() { |
11 var script = document.createElement("script"); | 11 var script = document.createElement("script"); |
12 assert_equals(script.event, ""); | 12 assert_equals(script.event, ""); |
13 assert_equals(script.htmlFor, ""); | 13 assert_equals(script.htmlFor, ""); |
14 }) | 14 }) |
15 test(function() { | 15 test(function() { |
16 var script = document.createElement("script"); | 16 var script = document.createElement("script"); |
17 script.setAttribute("event", "blah"); | 17 script.setAttribute("event", "blah"); |
18 script.setAttribute("for", "blah"); | 18 script.setAttribute("for", "blah"); |
19 assert_equals(script.event, ""); | 19 assert_equals(script.event, "blah"); |
20 assert_equals(script.htmlFor, ""); | 20 assert_equals(script.htmlFor, "blah"); |
21 assert_equals(script.getAttribute("event"), "blah"); | 21 assert_equals(script.getAttribute("event"), "blah"); |
22 assert_equals(script.getAttribute("for"), "blah"); | 22 assert_equals(script.getAttribute("for"), "blah"); |
23 }) | 23 }) |
24 test(function() { | 24 test(function() { |
25 var script = document.createElement("script"); | 25 var script = document.createElement("script"); |
26 script.setAttribute("event", "blah"); | 26 script.setAttribute("event", "blah"); |
27 script.setAttribute("for", "blah"); | 27 script.setAttribute("for", "blah"); |
28 script.event = "foo"; | 28 script.event = "foo"; |
29 script.htmlFor = "foo"; | 29 script.htmlFor = "foo"; |
30 assert_equals(script.event, ""); | 30 assert_equals(script.event, "foo"); |
31 assert_equals(script.htmlFor, ""); | 31 assert_equals(script.htmlFor, "foo"); |
32 assert_equals(script.getAttribute("event"), "blah"); | 32 assert_equals(script.getAttribute("event"), "foo"); |
33 assert_equals(script.getAttribute("for"), "blah"); | 33 assert_equals(script.getAttribute("for"), "foo"); |
34 }) | 34 }) |
35 test(function() { | 35 test(function() { |
36 var script = document.createElement("script"); | 36 var script = document.createElement("script"); |
37 script.setAttribute("event", "blah"); | 37 script.setAttribute("event", "blah"); |
38 script.setAttribute("for", "blah"); | 38 script.setAttribute("for", "blah"); |
39 script.event = null; | 39 script.event = null; |
40 script.htmlFor = null; | 40 script.htmlFor = null; |
41 assert_equals(script.event, ""); | 41 assert_equals(script.event, "null"); |
42 assert_equals(script.htmlFor, ""); | 42 assert_equals(script.htmlFor, "null"); |
43 assert_equals(script.getAttribute("event"), "blah"); | 43 assert_equals(script.getAttribute("event"), "null"); |
44 assert_equals(script.getAttribute("for"), "blah"); | 44 assert_equals(script.getAttribute("for"), "null"); |
45 }) | 45 }) |
46 test(function() { | 46 test(function() { |
47 var script = document.createElement("script"); | 47 var script = document.createElement("script"); |
48 script.setAttribute("event", "blah"); | 48 script.setAttribute("event", "blah"); |
49 script.setAttribute("for", "blah"); | 49 script.setAttribute("for", "blah"); |
50 script.event = undefined; | 50 script.event = undefined; |
51 script.htmlFor = undefined; | 51 script.htmlFor = undefined; |
52 assert_equals(script.event, ""); | 52 assert_equals(script.event, "undefined"); |
53 assert_equals(script.htmlFor, ""); | 53 assert_equals(script.htmlFor, "undefined"); |
54 assert_equals(script.getAttribute("event"), "blah"); | 54 assert_equals(script.getAttribute("event"), "undefined"); |
55 assert_equals(script.getAttribute("for"), "blah"); | 55 assert_equals(script.getAttribute("for"), "undefined"); |
56 }) | 56 }) |
57 </script> | 57 </script> |
OLD | NEW |