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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/dnd/event-mouse-coordinates-iframe.html

Issue 2471843005: Delegate dragend to the correct frame's EventHandler. (Closed)
Patch Set: Addressed some of the feedback. Created 4 years, 1 month 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 <!DOCTYPE html>
2 <meta charset="utf-8" />
3 <!-- This test checks whether we compute pointer coordinates correctly for the
4 dragstart, dragend, and drop events issued during drag-and-drop operations.
5 This test uses iframes, because they are an interesting case when computing
6 the clientX, clientY values from screen coordinates. -->
7 <link rel="stylesheet" href="resources/event-mouse-coordinates.css" />
8 <script src="../../resources/testharness.js"></script>
9 <script src="../../resources/testharnessreport.js"></script>
10 <script src="resources/event-mouse-coordinates.js"></script>
11
12 <style>
13 #iframe1 {
14 margin: 0;
15 padding: 0;
16 border: none;
17
18 position: absolute;
19 left: 200px;
20 top: 100px;
21 width: 600px;
22 height: 500px;
23 }
24 </style>
25
26 <p>
27 Please drag the "Drag Me" box into the "Drop Here" box.
28 </p>
29
30 <iframe id="iframe1" data-source="iframe1-srcdoc"></iframe>
31
32 <script id="iframe1-srcdoc" language="text/html">
33 <!DOCTYPE html>
34 <link rel="stylesheet" href="resources/event-mouse-coordinates.css" />
35 <aside class="dragged box" draggable="true">
36 Drag Me
37 </aside>
38
39 <aside class="dropzone box">
40 Drop Here
41 </aside>
42 </script>
43
44 <script>
45
46 promise_test((t) => {
47 return loadNestedFrames(document).then((frameDocument) => {
48 const dragCenter = elementCenter(frameDocument.querySelector('.dragged'));
49 const dropCenter = elementCenter(frameDocument.querySelector('.dropzone'));
50 return runDragTest(t, {
51 domRoot: frameDocument,
52 frameOffset: { x: 200, y: 100 },
53 start: { client: dragCenter, page: { x: 250, y: 150 }},
54 end: { client: dropCenter, page: { x: 450, y: 350 }},
55 });
56 });
57 }, 'Dragging and dropping DOM nodes in an iframe');
58
59 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698