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

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

Issue 2469863003: Delegate dragend to the correct frame's EventHandler. (Closed)
Patch Set: Applied dcheng's advice. 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/dnd/event-mouse-coordinates-iframe.html
diff --git a/third_party/WebKit/LayoutTests/fast/dnd/event-mouse-coordinates-iframe.html b/third_party/WebKit/LayoutTests/fast/dnd/event-mouse-coordinates-iframe.html
new file mode 100644
index 0000000000000000000000000000000000000000..da6f145fa6c79650b8ad7225e951701834dff400
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/dnd/event-mouse-coordinates-iframe.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="resources/event-mouse-coordinates.css" />
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<script src="resources/event-mouse-coordinates.js"></script>
+
+<style>
+#target-iframe {
+ margin: 0;
+ padding: 0;
+ border: none;
+
+ position: absolute;
+ left: 200px;
+ top: 100px;
+ width: 600px;
+ height: 500px;
+}
+</style>
+
+<p>
+ Please drag the "Drag Me" box into the "Drop Here" box.
+</p>
+
+<iframe id="target-iframe"></iframe>
+
+<script id="iframe-srcdoc" language="text/html">
+<!DOCTYPE html>
+<link rel="stylesheet" href="resources/event-mouse-coordinates.css" />
+<aside class="dragged box" draggable="true">
+ Drag Me
+</aside>
+
+<aside class="dropzone box">
+ Drop Here
+</aside>
+</script>
+
+<script>
+const iframeLoaded = new Promise((resolve, reject) => {
+ const target = document.getElementById('target-iframe');
+ const html = document.getElementById('iframe-srcdoc').textContent;
+ target.onload = (event) => resolve(true);
+
+ target.setAttribute('srcdoc', html);
+});
+
+promise_test((t) => {
+ return iframeLoaded.then(() => {
+ const frameDocument =
+ document.getElementById('target-iframe').contentDocument;
+ const dragCenter = elementCenter(frameDocument.querySelector('.dragged'));
+ const dropCenter = elementCenter(frameDocument.querySelector('.dropzone'));
+ return runDragTest(t, {
+ domRoot: frameDocument,
+ frameOffset: { x: 200, y: 100 },
+ start: { client: dragCenter, page: { x: 250, y: 150 }},
+ end: { client: dropCenter, page: { x: 450, y: 350 }},
+ });
+ });
+}, 'Dragging and dropping DOM nodes in an iframe');
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698