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

Unified Diff: LayoutTests/fast/forms/input-select-webkit-user-select-none.html

Issue 17225002: Make user-select:none not to affect editability (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-06-19T18:10:01 Created 7 years, 6 months 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: LayoutTests/fast/forms/input-select-webkit-user-select-none.html
diff --git a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
index 4859ec9df10e0be4d22161ab21c8747d955b0166..9ef825843bd0c058bad3e5cd1dc9b1295ab2507e 100644
--- a/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
+++ b/LayoutTests/fast/forms/input-select-webkit-user-select-none.html
@@ -1,26 +1,34 @@
-<html>
<head>
-<script>
-function test() {
- if (window.testRunner)
- testRunner.dumpAsText();
- var tf = document.getElementById('tf');
- tf.select();
- if (tf.selectionStart == 0 && tf.selectionEnd == 0) { // ;
- document.getElementById("result").innerHTML = "PASS";
- } else {
- document.getElementById("result").innerHTML = "FAIL: selection start is "
- + tf.selectionStart + " and end is " + tf.selectionEnd + ".";
- }
+<style>
+#sample {
+ -webkit-user-select: none;
+ user-select: none;
}
-</script>
+</style>
</head>
-<body onload="test()">
-<p>
-Tests behavior of select() in case &quot;-webkit-user-select: none&quot;
-attribute is specified to the input element. The field should not be selected.
-</p>
-<p><input type="text" id="tf" value="input text" style="-webkit-user-select: none"></input></p>
-<p id="result">TEST NOT RUN YET</p>
+<body>
+<script src="../js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+Manual step
+<ol>
+ <li>Click text input to focus it</li>
+ <li>Hit Ctrl+A to select contents of text input</li>
+</ol>
+<input id="sample" value="foobar">
+</div>
+<script>
+description('Tests user-select:none doesn\'t affect select()');
+function $(id) { return document.getElementById(id); }
+
+var sample = $('sample');
+sample.focus();
+sample.select();
+shouldBe('sample.selectionStart', '0');
+shouldBe('sample.selectionEnd', 'sample.value.length');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../js/resources/js-test-post.js"></script>
</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698