mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
34
tests/content/test_load_event.html
Normal file
34
tests/content/test_load_event.html
Normal file
|
@ -0,0 +1,34 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="harness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
var onloads = 0;
|
||||
function check(ev) {
|
||||
is_a(ev, Event);
|
||||
ev.preventDefault();
|
||||
is(ev.defaultPrevented, false);
|
||||
is(ev.target, document);
|
||||
is(ev.currentTarget, window);
|
||||
if (onloads == 2) {
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
window.onload = function(ev) {
|
||||
_fail("this inline handler should be overwritten");
|
||||
}
|
||||
window.onload = function(ev) {
|
||||
onloads++;
|
||||
is(onloads, 1);
|
||||
check(ev);
|
||||
}
|
||||
addEventListener("load", function(ev) {
|
||||
onloads++;
|
||||
is(onloads, 2);
|
||||
check(ev);
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue