Title: [186696] trunk/LayoutTests
Revision
186696
Author
[email protected]
Date
2015-07-10 17:04:59 -0700 (Fri, 10 Jul 2015)

Log Message

REGRESSION (r183133-r183138): Secondary clicking in whitespace selects preceding word
https://bugs.webkit.org/show_bug.cgi?id=146695
<rdar://problem/21441466>

Reviewed by Tim Horton.

Add a new test that checks for correct mac selection behavior for editable and read-only
text fields.

* platform/mac/editing/selection/context-menu-select-editability-expected.txt: Added.
* platform/mac/editing/selection/context-menu-select-editability.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (186695 => 186696)


--- trunk/LayoutTests/ChangeLog	2015-07-10 23:31:05 UTC (rev 186695)
+++ trunk/LayoutTests/ChangeLog	2015-07-11 00:04:59 UTC (rev 186696)
@@ -1,3 +1,17 @@
+2015-07-10  Brent Fulgham  <[email protected]>
+
+        REGRESSION (r183133-r183138): Secondary clicking in whitespace selects preceding word
+        https://bugs.webkit.org/show_bug.cgi?id=146695
+        <rdar://problem/21441466>
+
+        Reviewed by Tim Horton.
+
+        Add a new test that checks for correct mac selection behavior for editable and read-only
+        text fields.
+
+        * platform/mac/editing/selection/context-menu-select-editability-expected.txt: Added.
+        * platform/mac/editing/selection/context-menu-select-editability.html: Added.
+
 2015-07-10  Nan Wang  <[email protected]>
 
         Added tests for new role: table and cell.

Added: trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability-expected.txt (0 => 186696)


--- trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability-expected.txt	2015-07-11 00:04:59 UTC (rev 186696)
@@ -0,0 +1,19 @@
+This test checks that conext menu selection allows whitespace for non-editable fields. To test manually, right click on the blank text in the input box.
+
+The crowd says: New York, New York    is a helluva town!
+The crowd says: New York, New York    is a helluva town!
+
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
+
+
+PASS getSelectionForId('inputWhitespace') is ""
+PASS getSelectionForId('readOnlyWhitespace') is "New York, New York"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability.html (0 => 186696)


--- trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability.html	                        (rev 0)
+++ trunk/LayoutTests/platform/mac/editing/selection/context-menu-select-editability.html	2015-07-11 00:04:59 UTC (rev 186696)
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src=""
+</head>
+<body _onload_="onLoad()">
+<p>This test checks that conext menu selection allows whitespace for non-editable fields.
+To test manually, right click on the blank text in the input box.</p>
+<div style="width:500px; height:16px" id="input" contenteditable="true">
+<pre>The crowd says: New York, New York<span id="inputWhitespace">    </span>is a helluva town!</pre>
+</div>
+<div style="width:500px; height:16px" id="readOnlyInput" readonly>
+<pre>The crowd says: New York, New York<span id="readOnlyWhitespace">    </span>is a helluva town!</pre>
+</div>
+<div id="console">
+</body>
+<script>
+
+function getSelectionForId(elementId)
+{
+    var target = document.getElementById(elementId);
+
+    var x = target.offsetParent.offsetLeft + target.offsetLeft + target.clientWidth / 2;
+    var y = target.offsetParent.offsetTop + target.offsetTop + target.clientHeight / 2;
+
+    eventSender.mouseMoveTo(x, y);
+    eventSender.contextClick();
+
+    return window.getSelection().toString().trim();
+}
+
+function performTest()
+{
+    shouldBe("getSelectionForId('inputWhitespace')", '""');
+    shouldBe("getSelectionForId('readOnlyWhitespace')", '"New York, New York"');
+
+    finishJSTest();
+}
+
+function onLoad()
+{
+    if (window.testRunner) {
+        window.jsTestIsAsync = true;
+        testRunner.waitUntilDone();
+    }
+
+    setTimeout(performTest, 500); // Wait for page to display
+}
+</script>
+<script src=""
+</body>
+</html>
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to