| <script src="../../../resources/js-test.js"></script> |
| <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 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> |
| 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(); |
| shouldBe("getSelectionForId('inputWhitespace')", '""'); |
| shouldBe("getSelectionForId('readOnlyWhitespace')", '""'); |
| setTimeout(performTest, 500); // Wait for page to display |