summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/forms/text/input-select-webkit-user-select-none.html
blob: bc293fdf76b54aab497d88b046daf54bb295f2ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<head>
<style>
#sample {
    -webkit-user-select: none;
    user-select: none;
}
</style>
</head>
<body>
<script src="../../../resources/js-test.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>
</body>