mirror of
https://github.com/servo/servo.git
synced 2025-08-07 22:45:34 +01:00
Cargoify servo
This commit is contained in:
parent
db2f642c32
commit
c6ab60dbfc
1761 changed files with 8423 additions and 2294 deletions
42
tests/content/test_event_dispatch_order.html
Normal file
42
tests/content/test_event_dispatch_order.html
Normal file
|
@ -0,0 +1,42 @@
|
|||
<html>
|
||||
<head>
|
||||
<script src="harness.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<div id="foo"></div>
|
||||
<script>
|
||||
var sawBubble = false;
|
||||
var sawCapture = false;
|
||||
var sawBubbleTwice = false;
|
||||
function handler(ev) {
|
||||
is(ev.eventPhase, ev.AT_TARGET);
|
||||
is(sawBubble, false);
|
||||
is(sawCapture, false);
|
||||
sawBubble = true;
|
||||
}
|
||||
function handler2(ev) {
|
||||
is(ev.eventPhase, ev.AT_TARGET);
|
||||
is(sawBubble, true);
|
||||
is(sawCapture, false);
|
||||
sawCapture = true;
|
||||
}
|
||||
function handler3(ev) {
|
||||
is(ev.eventPhase, ev.AT_TARGET);
|
||||
is(sawBubble, true);
|
||||
is(sawCapture, true);
|
||||
sawBubbleTwice = true;
|
||||
}
|
||||
|
||||
var target = document.getElementById('foo');
|
||||
target.addEventListener('foopy', handler, false);
|
||||
target.addEventListener('foopy', handler2, true);
|
||||
target.addEventListener('foopy', handler3, false);
|
||||
var ev = new Event('foopy', {bubbles: true});
|
||||
target.dispatchEvent(ev);
|
||||
is(sawBubble, true);
|
||||
is(sawCapture, true);
|
||||
is(sawBubbleTwice, true);
|
||||
finish();
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
Loading…
Add table
Add a link
Reference in a new issue