diff options
Diffstat (limited to 'dom/events/test/test_marquee_events.html')
-rw-r--r-- | dom/events/test/test_marquee_events.html | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/dom/events/test/test_marquee_events.html b/dom/events/test/test_marquee_events.html new file mode 100644 index 0000000000..22d0eafdf1 --- /dev/null +++ b/dom/events/test/test_marquee_events.html @@ -0,0 +1,31 @@ +<html> +<head> + <meta charset="utf-8"> + <title>Test for bug 1425874</title> + <link rel="stylesheet" href="/tests/SimpleTest/test.css"> + <script src="/tests/SimpleTest/SimpleTest.js"></script> + <script src="/tests/SimpleTest/EventUtils.js"></script> +</head> +<body> + <script> + var wasEventCalled; + function callEventWithAttributeHandler(element, evt) { + wasEventCalled = false; + let el = document.createElement(element); + el.setAttribute(`on${evt}`, "wasEventCalled = true"); + el.dispatchEvent(new Event(evt)); + return wasEventCalled; + } + + info("Make sure the EventNameType_HTMLMarqueeOnly events only compile for marquee"); + + ok(!callEventWithAttributeHandler("div", "bounce"), "no onbounce for div"); + ok(!callEventWithAttributeHandler("div", "finish"), "no onfinish for div"); + ok(!callEventWithAttributeHandler("div", "start"), "no onstart for div"); + + ok(callEventWithAttributeHandler("marquee", "bounce"), "onbounce for marquee"); + ok(callEventWithAttributeHandler("marquee", "finish"), "onfinish for marquee"); + ok(callEventWithAttributeHandler("marquee", "start"), "onstart for marquee"); + </script> +</body> +</html> |