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

Side by Side Diff: LayoutTests/editing/selection/user-select-js-property.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <script src="../../fast/js/resources/js-test-pre.js"></script>
2 <div id="container">
3 <p id="description"></p>
4 <div id="sample1" contenteditable="true">editable</div>
5 <div id="sample2" contenteditable="false">uneditable</div>
6 </div>
7 </div>
8 <script>
9 function $(id) { return document.getElementById(id); }
10 description('Test setting CSSStyleDeclaration.webkitUserStyle');
11
12 var selection = window.getSelection();
13 function setSelection(node)
14 {
15 var range = document.createRange();
16 range.selectNodeContents(node);
17 selection.empty();
18 selection.addRange(range);
19 }
20
21 // user-select:none in editable element
22 $('sample1').style.webkitUserSelect = 'none';
23 setSelection($('sample1'));
24 shouldBeEqualToString('selection.type', 'Range');
25
26 // user-select:none in uneditable element
27 $('sample2').style.webkitUserSelect = 'none';
28 setSelection($('sample2'));
29 shouldBeEqualToString('selection.type', 'None');
30
31 if (window.testRunner)
32 $('container').outerHTML = '';
33 </script>
34 <script src="../../fast/js/resources/js-test-post.js"></script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698