Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <script src="../../resources/testharness.js"></script> | |
| 2 <script src="../../resources/testharnessreport.js"></script> | |
| 3 | |
| 4 <body onload="runTest()"> | |
|
bokan
2016/07/01 19:27:29
nit: omit body tag, use window.onload or addEventL
Navid Zolghadr
2016/07/04 14:58:11
Done.
| |
| 5 | |
| 6 <style> | |
| 7 #target { | |
| 8 width: 200px; | |
| 9 height: 200px; | |
| 10 } | |
| 11 </style> | |
| 12 | |
| 13 <p>This is the top level window.</p> | |
| 14 <p>Click somewhere. Move the mouse into the iframe.</p> | |
| 15 <p>Mouse move should be received by the iframe.</p> | |
| 16 <iframe id="target" srcdoc=" | |
| 17 <p>This is the iframe.</p> | |
| 18 <script> | |
| 19 document.addEventListener('mousemove', function() { | |
| 20 parent.mouseMoveReceived(); | |
| 21 }); | |
| 22 </script> | |
| 23 "></iframe> | |
| 24 | |
| 25 <script type="text/javascript"> | |
|
bokan
2016/07/01 19:27:29
nit: no need for `type` attribute
Navid Zolghadr
2016/07/04 14:58:11
Done.
| |
| 26 var test_mousemove = async_test("Inner frame should receive mousemove even w hen mouseup preventDefault was called in the parent iframe."); | |
|
bokan
2016/07/01 19:27:29
nit: s/called in the parent iframe/called in the p
Navid Zolghadr
2016/07/04 14:58:11
Done.
| |
| 27 var state = 0; | |
|
bokan
2016/07/01 19:27:29
nit: state -> mouseUpPrevented or similar and make
Navid Zolghadr
2016/07/04 14:58:11
Done.
| |
| 28 function mouseMoveReceived() { | |
| 29 if (state == 1) | |
| 30 test_mousemove.done(); | |
| 31 } | |
| 32 document.addEventListener("mouseup", function(e) { | |
| 33 e.preventDefault(); | |
| 34 state = 1; | |
| 35 }); | |
| 36 | |
| 37 function runTest() { | |
| 38 if (window.eventSender) { | |
| 39 var targetRect = document.getElementById("target").getBoundingClientRect (); | |
| 40 eventSender.mouseMoveTo(targetRect.right+10, targetRect.bottom+10); | |
| 41 eventSender.mouseDown(0); | |
| 42 eventSender.mouseUp(0); | |
| 43 eventSender.mouseMoveTo(targetRect.right-10, targetRect.bottom-10); | |
| 44 } | |
| 45 } | |
| 46 </script> | |
| 47 </body> | |
| OLD | NEW |