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

Unified Diff: LayoutTests/editing/selection/user-select-none-in-editable.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-none-in-editable.html
diff --git a/LayoutTests/editing/selection/user-select-none-in-editable.html b/LayoutTests/editing/selection/user-select-none-in-editable.html
new file mode 100644
index 0000000000000000000000000000000000000000..dc9552e65d2d6c42d6e5486274cd8bfd21244f59
--- /dev/null
+++ b/LayoutTests/editing/selection/user-select-none-in-editable.html
@@ -0,0 +1,40 @@
+<style>
+.user-select-none {
+ -webkit-user-select: none;
+ -khtml-user-select: none;
+ -moz-user-select: none;
+ -ms-user-select: none;
+ -o-user-select: none;
+ user-select: none;
+}
+</style>
+<script src="../../fast/js/resources/js-test-pre.js"></script>
+<div id="container">
+<p id="description"></p>
+Manual step:
+<ol>
+<li>Move caret after "c"</li>
+<li>Hit right arrow key twice</li>
+<li>Caret should be after "Y"</li>
+</ol>
+<div id="sample1" contenteditable="true">
+abc<span id="sample2" class="user-select-none">XYZ</span>def
+</div>
+</div>
+<script>
+function $(id) { return document.getElementById(id); }
+description('Test caret movement into user-select:none content.');
+
+var sample1 = $('sample1');
+var sample2 = $('sample2');
+var selection = window.getSelection();
+selection.setPosition(sample1, 1);
+selection.modify('move', 'forward', 'character');
+selection.modify('move', 'forward', 'character');
+shouldBe('selection.focusNode', 'sample2.firstChild');
+shouldBe('selection.focusOffset', '2');
+
+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