|
1 <!DOCTYPE HTML> |
|
2 <!-- |
|
3 https://bugzilla.mozilla.org/show_bug.cgi?id=737087 |
|
4 --> |
|
5 <title>Test for Bug 737087</title> |
|
6 <script src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <link rel="stylesheet" href="/tests/SimpleTest/test.css"/> |
|
8 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=737087">Mozilla Bug 737087</a> |
|
9 <script> |
|
10 |
|
11 /** Test for Bug 737087 **/ |
|
12 SimpleTest.waitForExplicitFinish(); |
|
13 |
|
14 var bubbled = false; |
|
15 var capturedEvent = null; |
|
16 var inlineFiredEvent = null; |
|
17 |
|
18 addEventListener("error", function() { bubbled = true }); |
|
19 addEventListener("error", function(e) { |
|
20 capturedEvent = e; |
|
21 is(typeof e, "object", "Error event must be object"); |
|
22 is(Object.getPrototypeOf(e), Event.prototype, "Error event must be Event"); |
|
23 is(e.bubbles, false, "e.bubbles must be false"); |
|
24 is(e.cancelable, false, "e.cancelable must be false"); |
|
25 }, true); |
|
26 |
|
27 addLoadEvent(function() { |
|
28 is(bubbled, false, "Error event must not bubble"); |
|
29 isnot(capturedEvent, null, "Error event must be captured"); |
|
30 isnot(inlineFiredEvent, null, "Inline error handler must fire"); |
|
31 is(capturedEvent, inlineFiredEvent, |
|
32 "Same event must be handled by both handlers"); |
|
33 SimpleTest.finish(); |
|
34 }); |
|
35 </script> |
|
36 <script src=nonexistent |
|
37 onerror="inlineFiredEvent = event"></script> |