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

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: Add comments Created 4 years, 5 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/input/EventHandler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698