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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: LayoutTests/editing/selection/user-select-js-property.html
diff --git a/LayoutTests/editing/selection/user-select-js-property.html b/LayoutTests/editing/selection/user-select-js-property.html
new file mode 100644
index 0000000000000000000000000000000000000000..8d8a496ac346a909ccd198a163088dd34d53553c
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-js-property.html
@@ -0,0 +1,34 @@
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+<div id="sample1" contenteditable="true">editable</div>
+<div id="sample2" contenteditable="false">uneditable</div>
+</div>
+</div>
+<script>
+function $(id) { return document.getElementById(id); }
+description('Test setting CSSStyleDeclaration.webkitUserStyle');
+
+var selection = window.getSelection();
+function setSelection(node)
+{
+ var range = document.createRange();
+ range.selectNodeContents(node);
+ selection.empty();
+ selection.addRange(range);
+}
+
+// user-select:none in editable element
+$('sample1').style.webkitUserSelect = 'none';
+setSelection($('sample1'));
+shouldBeEqualToString('selection.type', 'Range');
+
+// user-select:none in uneditable element
+$('sample2').style.webkitUserSelect = 'none';
+setSelection($('sample2'));
+shouldBeEqualToString('selection.type', 'None');
+
+if (window.testRunner)
+ $('container').outerHTML = '';
+</script>
+<script src="../../fast/js/resources/js-test-post.js"></script>

Powered by Google App Engine
This is Rietveld 408576698