1
0
mirror of https://github.com/roytam1/UXP.git synced 2026-06-10 18:38:34 +00:00
Files
UXP/testing/web-platform/tests/html/webappapis/scripting/events/event-handler-attributes-body-window.html
T

35 lines
956 B
HTML

<!DOCTYPE html>
<title>HTMLBodyElement event handlers</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="log"></div>
<body>
<script>
function f() {
return 0;
}
var handlers = ['blur','error','focus','load','resize','scroll',
'afterprint','beforeprint','beforeunload','hashchange',
'languagechange','message','offline','online','pagehide',
'pageshow','popstate','storage','unload'];
handlers.forEach(function(handler) {
test(function() {
document.body['on' + handler] = f;
assert_equals(window['on' + handler], f);
}, handler);
});
handlers.forEach(function(handler) {
document.body['on' + handler] = null;
});
handlers.forEach(function(handler) {
test(function() {
assert_equals(document.body['on' + handler], null);
assert_equals(window['on' + handler], null);
}, handler + " removal");
});
</script>