Diff
Modified: trunk/LayoutTests/ChangeLog (231187 => 231188)
--- trunk/LayoutTests/ChangeLog 2018-05-01 00:23:24 UTC (rev 231187)
+++ trunk/LayoutTests/ChangeLog 2018-05-01 00:35:16 UTC (rev 231188)
@@ -1,3 +1,29 @@
+2018-04-30 Megan Gardner <[email protected]>
+
+ Add tests for selection in content editable
+ https://bugs.webkit.org/show_bug.cgi?id=185144
+
+ Reviewed by Wenson Hsieh.
+
+ Tests that should cover selection in content editable, both with and without a keyboard present. Also fixing two tests that had errors.
+
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt: Added.
+ * fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html: Added.
+ * fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html:
+ * fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html:
+
2018-04-30 Jer Noble <[email protected]>
<img src="" does not display on ios despite Accept: video/* advertisement
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,8 @@
+PASS: Has Caret Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-down-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var tapPointX = editableTargetRect.x + editableTargetRect.width / 2;
+ var tapPointY = editableTargetRect.y + editableTargetRect.height / 2;
+ var doubleTapPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var doubleTapPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + firstTargetRect.height + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x + firstTargetRect.width;
+ var dragY2 = secondTargetRect.y + secondTargetRect.height + noneditableToEditableOffset;
+ var dragY3 = thirdTargetRect.y + thirdTargetRect.height + noneditableToEditableOffset;
+ var dragY4 = firstTargetRect.y - firstTargetRect.height + noneditableToEditableOffset;
+
+ await tapAtPoint(tapPointX, tapPointY);
+ if (document.getSelection().type == "Caret")
+ output += 'PASS: Has Caret Selection';
+ else
+ output += 'FAIL: failed to activate caret as a result of a tap. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await didShowKeyboard();
+
+ await doubleTapAtPoint(doubleTapPointX, doubleTapPointY);
+ if (document.getSelection().toString() == "sed")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididunt ut labore et dolore ma")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
+ if (document.getSelection().toString() == "sed")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
+ if (document.getSelection().toString() == "s")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging up. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, <span id="firstSelection">sed</span> do eiusmod tempor incididun<span id="secondSelection"></span>t ut labore et dolore mag<span id="thirdSelection"></span>na aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,8 @@
+PASS: Has Caret Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-left-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var tapPointX = editableTargetRect.x + editableTargetRect.width / 2;
+ var tapPointY = editableTargetRect.y + editableTargetRect.height / 2;
+ var doubleTapPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var doubleTapPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x;
+ var dragX2 = secondTargetRect.x;
+ var dragX3 = thirdTargetRect.x;
+ var dragX4 = firstTargetRect.x + firstTargetRect.width;
+
+ await tapAtPoint(tapPointX, tapPointY);
+ if (document.getSelection().type == "Caret")
+ output += 'PASS: Has Caret Selection';
+ else
+ output += 'FAIL: failed to activate caret as a result of a tap. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await didShowKeyboard();
+
+ await doubleTapAtPoint(doubleTapPointX, doubleTapPointY);
+ if (document.getSelection().toString() == "magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "aliqua magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX3, dragY);
+ if (document.getSelection().toString() == "dolore aliqua magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX3, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "aliqua magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX, dragY);
+ if (document.getSelection().toString() == "magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX4, dragY);
+ if (document.getSelection().toString() == "a")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging right. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et <span id="thirdSelection"></span>dolore <span id="secondSelection"></span>aliqua <span id="firstSelection">magna</span>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore aliqua magna. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,8 @@
+PASS: Has Caret Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/double-tap-on-editable-content-for-selection-then-drag-up-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,132 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var tapPointX = editableTargetRect.x + editableTargetRect.width / 2;
+ var tapPointY = editableTargetRect.y + editableTargetRect.height / 2;
+ var doubleTapPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var doubleTapPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x;
+ var dragY2 = secondTargetRect.y + noneditableToEditableOffset;
+ var dragY3 = thirdTargetRect.y + noneditableToEditableOffset;
+ var dragY4 = firstTargetRect.y + firstTargetRect.height + noneditableToEditableOffset;
+
+ await tapAtPoint(tapPointX, tapPointY);
+ if (document.getSelection().type == "Caret")
+ output += 'PASS: Has Caret Selection';
+ else
+ output += 'FAIL: failed to activate caret as a result of a tap. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await didShowKeyboard();
+
+ await doubleTapAtPoint(doubleTapPointX, doubleTapPointY);
+ if (document.getSelection().toString() == "at")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt at")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
+ if (document.getSelection().toString() == " adipiscing elit, sed do eiusmod tempor incididunt at")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt at")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
+ if (document.getSelection().toString() == "at")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
+ if (document.getSelection().toString() == "t")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging down. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur<span id="thirdSelection"></span> adipiscing elit, sed d<span id="secondSelection"></span>o eiusmod tempor incididunt <span id="firstSelection">at</span> labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt at labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,7 @@
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-down-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var pressPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + firstTargetRect.height + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x + firstTargetRect.width;
+ var dragY2 = secondTargetRect.y + secondTargetRect.height + noneditableToEditableOffset;
+ var dragY3 = thirdTargetRect.y + thirdTargetRect.height + noneditableToEditableOffset;
+ var dragY4 = firstTargetRect.y - firstTargetRect.height + noneditableToEditableOffset;
+
+ await longPressAtPoint(pressPointX, pressPointY);
+ if (document.getSelection().toString() == "sed")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididunt ut labore et dolore ma")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
+ if (document.getSelection().toString() == "sed do eiusmod tempor incididun")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
+ if (document.getSelection().toString() == "sed")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
+ if (document.getSelection().toString() == "s")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging up. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, <span id="firstSelection">sed</span> do eiusmod tempor incididun<span id="secondSelection"></span>t ut labore et dolore mag<span id="thirdSelection"></span>na aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,7 @@
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-left-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var pressPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x;
+ var dragX2 = secondTargetRect.x;
+ var dragX3 = thirdTargetRect.x;
+ var dragX4 = firstTargetRect.x + firstTargetRect.width;
+
+ await longPressAtPoint(pressPointX, pressPointY);
+ if (document.getSelection().toString() == "aliqua")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "magna aliqua")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX3, dragY);
+ if (document.getSelection().toString() == "dolore magna aliqua")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX3, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "magna aliqua")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX, dragY);
+ if (document.getSelection().toString() == "aliqua")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX4, dragY);
+ if (document.getSelection().toString() == "a")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging right. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et <span id="thirdSelection"></span>dolore <span id="secondSelection"></span>magna <span id="firstSelection">aliqua</span>. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,7 @@
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-right-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var pressPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + firstTargetRect.height + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x + firstTargetRect.width;
+ var dragX2 = secondTargetRect.x;
+ var dragX3 = thirdTargetRect.x;
+ var dragX4 = firstTargetRect.x - firstTargetRect.width;
+
+ await longPressAtPoint(pressPointX, pressPointY);
+ if (document.getSelection().toString() == "magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "magna aliqua.")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX3, dragY);
+ if (document.getSelection().toString() == "magna aliqua. Ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX3, dragY, dragX2, dragY);
+ if (document.getSelection().toString() == "magna aliqua.")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX, dragY);
+ if (document.getSelection().toString() == "magna")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX4, dragY);
+ if (document.getSelection().toString() == "m")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging left. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore <span id="firstSelection">magna</span> aliqua.<span id="secondSelection"></span> Ut<span id="thirdSelection"></span> enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text-expected.txt 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,7 @@
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+PASS: Correct Selection
+
Added: trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html (0 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html (rev 0)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-on-editable-content-then-drag-up-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -0,0 +1,121 @@
+<!DOCTYPE html>
+
+<html>
+<head>
+ <script src=""
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsText();
+ testRunner.waitUntilDone();
+ }
+
+ async function runTest()
+ {
+ if (!testRunner.runUIScript)
+ return;
+
+ var output = '';
+ var editableTargetRect = document.getElementById('editable').getBoundingClientRect();
+ var firstTargetRect = document.getElementById('firstSelection').getBoundingClientRect();
+ var secondTargetRect = document.getElementById('secondSelection').getBoundingClientRect();
+ var thirdTargetRect = document.getElementById('thirdSelection').getBoundingClientRect();
+ var noneditableToEditableOffset = document.getElementById('editable').getBoundingClientRect().y - document.getElementById('noneditable').getBoundingClientRect().y;
+
+ var pressPointX = firstTargetRect.x + firstTargetRect.width / 2;
+ var pressPointY = firstTargetRect.y + firstTargetRect.height / 2 + noneditableToEditableOffset;
+ var dragY = firstTargetRect.y + noneditableToEditableOffset;
+ var dragX = firstTargetRect.x;
+ var dragY2 = secondTargetRect.y + noneditableToEditableOffset;
+ var dragY3 = thirdTargetRect.y + noneditableToEditableOffset;
+ var dragY4 = firstTargetRect.y + firstTargetRect.height + noneditableToEditableOffset;
+
+ await longPressAtPoint(pressPointX, pressPointY);
+ if (document.getSelection().toString() == "ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
+ if (document.getSelection().toString() == " adipiscing elit, sed do eiusmod tempor incididunt ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
+ if (document.getSelection().toString() == "ut")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+
+ var result = await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY4);
+ if (document.getSelection().toString() == "t")
+ output += 'PASS: Correct Selection';
+ else
+ output += 'FAIL: failed to reduce selection to a single character by dragging down. Incorrect Selection: ' + document.getSelection().toString();
+ output += '<br>';
+ output += result;
+
+ var noneditableElement = document.getElementById('noneditable');
+ noneditableElement.parentNode.removeChild(noneditableElement);
+ var editableElement = document.getElementById('editable');
+ editableElement.parentNode.removeChild(editableElement);
+ document.getElementById('target').innerHTML = output;
+ testRunner.notifyDone();
+ }
+
+ window.addEventListener('load', runTest, false);
+ </script>
+ <style>
+ #noneditable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #editable {
+ height: 200px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ #target {
+ height: 50px;
+ width: 300px;
+ background-color: silver;
+ font-family: monospace;
+ font-size: 18px;
+ }
+ </style>
+ <meta name="viewport" content="initial-scale=1">
+</head>
+<body>
+ <div id="noneditable">
+ <p>Lorem ipsum dolor sit amet, consectetur<span id="thirdSelection"></span> adipiscing elit, sed d<span id="secondSelection"></span>o eiusmod tempor incididunt <span id="firstSelection">ut</span> labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="editable" contenteditable>
+ <p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>
+ </div>
+ <div id="target">
+ This test requires UIScriptController to run.
+ </div>
+</body>
+</html>
Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html (231187 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html 2018-05-01 00:23:24 UTC (rev 231187)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-right-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -55,7 +55,7 @@
output += 'FAIL: failed to deselect word after a drag. Incorrect Selection: ' + document.getSelection().toString();
output += '<br>';
- await(touchAndDragFromPointToPoint(dragX2, dragY, dragX, dragY);
+ await touchAndDragFromPointToPoint(dragX2, dragY, dragX, dragY);
if (document.getSelection().toString() == "magna")
output += 'PASS: Correct Selection';
else
Modified: trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html (231187 => 231188)
--- trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html 2018-05-01 00:23:24 UTC (rev 231187)
+++ trunk/LayoutTests/fast/events/touch/ios/long-press-then-drag-up-to-change-selected-text.html 2018-05-01 00:35:16 UTC (rev 231188)
@@ -28,7 +28,7 @@
var dragY4 = firstTargetRect.y + firstTargetRect.height;
await longPressAtPoint(pressPointX, pressPointY);
- if (document.getSelection().toString() == "Ut")
+ if (document.getSelection().toString() == "ut")
output += 'PASS: Correct Selection';
else
output += 'FAIL: failed to select a word as a result of a long press. Incorrect Selection: ' + document.getSelection().toString();
@@ -35,7 +35,7 @@
output += '<br>';
await touchAndDragFromPointToPoint(dragX, dragY, dragX, dragY2);
- if (document.getSelection().toString() == "e et dolore magna aliqua. Ut")
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
output += 'PASS: Correct Selection';
else
output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
@@ -42,7 +42,7 @@
output += '<br>';
await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY3);
- if (document.getSelection().toString() == "mod tempor incididunt ut labore et dolore magna aliqua. Ut")
+ if (document.getSelection().toString() == " adipiscing elit, sed do eiusmod tempor incididunt ut")
output += 'PASS: Correct Selection';
else
output += 'FAIL: failed to select additional line after a drag. Incorrect Selection: ' + document.getSelection().toString();
@@ -49,7 +49,7 @@
output += '<br>';
await touchAndDragFromPointToPoint(dragX, dragY3, dragX, dragY2);
- if (document.getSelection().toString() == "e et dolore magna aliqua. Ut")
+ if (document.getSelection().toString() == "o eiusmod tempor incididunt ut")
output += 'PASS: Correct Selection';
else
output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();
@@ -56,7 +56,7 @@
output += '<br>';
await touchAndDragFromPointToPoint(dragX, dragY2, dragX, dragY);
- if (document.getSelection().toString() == "Ut")
+ if (document.getSelection().toString() == "ut")
output += 'PASS: Correct Selection';
else
output += 'FAIL: failed to deselect line after a drag. Incorrect Selection: ' + document.getSelection().toString();