diff options
Diffstat (limited to 'testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/error.image.html')
-rw-r--r-- | testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/error.image.html | 65 |
1 files changed, 65 insertions, 0 deletions
diff --git a/testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/error.image.html b/testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/error.image.html new file mode 100644 index 000000000..a629652d4 --- /dev/null +++ b/testing/web-platform/tests/uievents/legacy-domevents-tests/submissions/Microsoft/error.image.html @@ -0,0 +1,65 @@ +<!DOCTYPE HTML> +<html> + <head> + <title> W3C DOM Level 3 Event: error </title> + <script type="text/javascript"> + var PassTest = function() + { + document.getElementById("testresult").firstChild.data = "PASS"; + } + + var FailTest = function() + { + document.getElementById("testresult").firstChild.data = "FAIL"; + } + + function TestCapture(evt) + { + TARGET = document.getElementById("target"); + + if ((evt.type == EVENT) && (evt.currentTarget == window) && (evt.target == TARGET)) + { + TestResult = true; + } + else + { + TestResult = false; + } + } + + var EVENT = "error"; + var TARGET; + var TestResult = false; + + try + { + window.addEventListener(EVENT, TestCapture, true); + } + catch(ex) + { + TestResult = false; + } + + window.onload = function() + { + if (true == TestResult) + { + PassTest(); + } + else + { + FailTest(); + } + } + </script> + </head> + <body> + <h4>Test Description: error event fires when an IMG resource failed to load.</h4> + + <img id="target" src="./support/InvalidBitMap.png" alt="ERROR"> + + <p>Test passes if the word "PASS" appears below.</p> + <div>Test result: </div> + <div id='testresult'>FAIL</div> + </body> +</html>
\ No newline at end of file |