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

Unified Diff: LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html

Issue 50433002: Fix dragging text inside a input element nested in a draggable element. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Better names and comments Created 7 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
« no previous file with comments | « no previous file | LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html
diff --git a/LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html b/LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..93243a5ed96426627ae84a550a3e4622db0972f9
--- /dev/null
+++ b/LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script>
+function log(s)
+{
+ document.getElementById('console')
+ .appendChild(document.createElement('div'))
+ .appendChild(document.createTextNode(s));
+}
+
+function onDragStart(e)
+{
+ if (e.target.id == 'textInput')
+ log('PASS');
+ else
+ log('FAIL: target element was ' + e.target);
+}
+
+function runTest()
+{
+ document.getElementById('draggableElement').addEventListener('dragstart', onDragStart);
+ if (!window.testRunner)
+ return;
+ testRunner.dumpAsText();
+
+ var textInput = document.getElementById('textInput');
+ textInput.focus();
+ textInput.select();
+ var startX = textInput.offsetLeft + textInput.offsetWidth / 2;
+ var startY = textInput.offsetTop + textInput.offsetHeight / 2;
+ eventSender.mouseMoveTo(startX, startY);
+ eventSender.mouseDown();
+ eventSender.leapForward(200);
+ eventSender.mouseMoveTo(startX + 100, startY + 100);
+ eventSender.mouseUp();
+}
+</script>
+</head>
+<body onload="runTest()">
+<p>Simple test that dragging selected text in an input box nested in a draggable element works.
+<div id="draggableElement" draggable="true">
+Draggable div wrapping a text input box:
+<input id="textInput" type="text" value="Select and drag me"></input>
+</div>
+<div id="console"></div>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/editing/selection/drag-input-text-nested-in-draggable-element-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698