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

Unified Diff: LayoutTests/editing/selection/select-first-letter.html

Issue 20681004: Make first-letter style to work with editing Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 2013-09-20T18:27:32 Created 7 years, 3 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/select-first-letter.html
diff --git a/LayoutTests/editing/selection/select-first-letter.html b/LayoutTests/editing/selection/select-first-letter.html
new file mode 100644
index 0000000000000000000000000000000000000000..9ac9221e583855911053784d5116adb2196e781c
--- /dev/null
+++ b/LayoutTests/editing/selection/select-first-letter.html
@@ -0,0 +1,20 @@
+<head>
+<style>
+p:first-letter {
+ color: red;
+}
+</style>
+</head>
+<body>
+<p>All text are selected.</p>
+<div id="output"></div>
+</body>
+<script>
+var range = document.createRange();
+range.selectNode(document.querySelector('p'));
+range.startContainer.focus();
+var selection = window.getSelection();
+selection.removeAllRanges();
+selection.addRange(range);
+document.getElementById('output').textContent = selection.anchorOffset + ' ' + selection.focusOffset
+</script>

Powered by Google App Engine
This is Rietveld 408576698