Bug 1885602 - Part 5: Implement navigating to the SUMO help topic from the menu heade...
[gecko.git] / dom / bindings / test / test_treat_non_object_as_null.html
blob785a2ebc71be361c3311c2dfeb3d5f6db9a457dc
1 <!DOCTYPE HTML>
2 <html>
3 <!--
4 https://bugzilla.mozilla.org/show_bug.cgi?id=952365
5 -->
6 <head>
7 <meta charset="utf-8">
8 <title>Test for Bug 952365</title>
9 <script src="/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
11 <script type="application/javascript">
13 /** Test for Bug 952365 **/
15 var onvolumechange;
16 var x = {};
18 (function() {
19 onvolumechange = x;
20 is(onvolumechange, x,
21 "Should preserve an object value when assigning to event handler");
22 // Test that we don't try to actually call the non-callable object
23 window.dispatchEvent(new Event("volumechange"));
24 onvolumechange = 5;
25 is(onvolumechange, null,
26 "Non-object values should become null when assigning to event handler");
27 })();
28 </script>
29 </head>
30 <body>
31 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=952365">Mozilla Bug 952365</a>
32 <p id="display"></p>
33 <div id="content" style="display: none">
35 </div>
36 <pre id="test">
37 </pre>
38 </body>
39 </html>