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

Side by Side Diff: LayoutTests/editing/deleting/merge-paragraph-with-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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <head>
2 <style>
3 .test:first-letter {
4 color: red;
5 }
6 </style>
7 </head>
8 <body>
9 <div id="container">
10 <div id="sample" contenteditable="true">
11 <p class="test">abcdefgh</p>
12 </div>
13 </div>
14 <script src="../../fast/js/resources/js-test-pre.js"></script>
15 <script>
16 function $(id) { return document.getElementById(id); }
17 $('sample').focus();
18
19 var range = document.createRange();
20 range.setStart($('sample').querySelector('p.test').firstChild, 4);
21 var selection = window.getSelection();
22 selection.removeAllRanges();
23 selection.addRange(range);
24
25 debug('Insert newline');
26 document.execCommand('InsertText', false, '\n');
27 shouldBeEqualToString('selection.type', 'Caret');
28 shouldBe('selection.anchorNode', 'document.querySelectorAll("p.test")[1].firstCh ild');
29 shouldBe('selection.anchorOffset', '0');
30 shouldBeEqualToString('selection.anchorNode.textContent', 'efgh');
31
32 debug('Delete newline');
33 document.execCommand('Delete');
34 shouldBeEqualToString('selection.type', 'Caret');
35 shouldBe('selection.anchorNode', 'document.querySelectorAll("p.test")[0].firstCh ild');
36 shouldBe('selection.anchorOffset', '4');
37 shouldBeEqualToString('selection.anchorNode.textContent', 'abcdefgh');
38
39 if (window.testRunner)
40 $('container').outerHTML = '';
41 </script>
42 <script src="../../fast/js/resources/js-test-post.js"></script>
43 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698