Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(358)

Side by Side Diff: third_party/WebKit/LayoutTests/fast/events/mouse-up-preventDefault-dragstate.html

Issue 2042333006: Reset drag state variables on mouse up (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <script src="../../resources/testharness.js"></script>
2 <script src="../../resources/testharnessreport.js"></script>
3
4 <body onload="runTest()">
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">
26 var test_mousemove = async_test("Inner frame should receive mousemove even w hen mouseup preventDefault was called in the parent iframe.");
27 var state = 0;
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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698