gecko-dev/dom/events/test/test_marquee_events.html
2018-11-08 14:46:45 +00:00

32 lines
1.2 KiB
HTML

<html>
<head>
<meta charset="utf-8">
<title>Test for bug 1425874</title>
<link rel="stylesheet" href="/tests/SimpleTest/test.css">
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" 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>