| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Event phases order</title> | 2 <title>Event phases order</title> |
| 3 <script src="../../../../resources/testharness.js"></script> | 3 <script src="/resources/testharness.js"></script> |
| 4 <script src="../../../../resources/testharnessreport.js"></script> | 4 <script src="/resources/testharnessreport.js"></script> |
| 5 <div id="log"></div> | 5 <div id="log"></div> |
| 6 <script> | 6 <script> |
| 7 async_test(function() { | 7 async_test(function() { |
| 8 document.addEventListener('DOMContentLoaded', this.step_func_done(function()
{ | 8 document.addEventListener('DOMContentLoaded', this.step_func_done(function()
{ |
| 9 var parent = document.getElementById('parent'); | 9 var parent = document.getElementById('parent'); |
| 10 var child = document.getElementById('child'); | 10 var child = document.getElementById('child'); |
| 11 | 11 |
| 12 var order = []; | 12 var order = []; |
| 13 | 13 |
| 14 parent.addEventListener('click', this.step_func(function(){ order.push(1
) }), true); | 14 parent.addEventListener('click', this.step_func(function(){ order.push(1
) }), true); |
| 15 child.addEventListener('click', this.step_func(function(){ order.push(2)
}), false); | 15 child.addEventListener('click', this.step_func(function(){ order.push(2)
}), false); |
| 16 parent.addEventListener('click', this.step_func(function(){ order.push(3
) }), false); | 16 parent.addEventListener('click', this.step_func(function(){ order.push(3
) }), false); |
| 17 | 17 |
| 18 child.dispatchEvent(new Event('click', {bubbles: true})); | 18 child.dispatchEvent(new Event('click', {bubbles: true})); |
| 19 | 19 |
| 20 assert_array_equals(order, [1, 2, 3]); | 20 assert_array_equals(order, [1, 2, 3]); |
| 21 })); | 21 })); |
| 22 }, "Event phases order"); | 22 }, "Event phases order"); |
| 23 </script> | 23 </script> |
| 24 <div id="parent"> | 24 <div id="parent"> |
| 25 <div id="child"></div> | 25 <div id="child"></div> |
| 26 </div> | 26 </div> |
| OLD | NEW |