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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/inserting/insert-space-at-start-of-wrapped-line.html

Issue 2618613004: Insert a line break when space is inserted at the top of wrapped lines (Closed)
Patch Set: Fix test on Mac Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!doctype HTML>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
4 <style>
5 #textarea, #plaintext, #richedit {
6 font-family: 'Courier', monospace;
7 width: 10ch;
8 }
9 #plaintext, #richedit {
10 border: 1px solid black;
11 white-space: pre-wrap;
12 }
13 </style>
14 <textarea id="textarea">12345 67</textarea>
15 <div id="plaintext" contenteditable="plaintext-only">12345 67</div>
16 <div id="richedit" contenteditable>12345 67</div>
17 <script>
18 (function () {
19 if (!window.eventSender) {
yosin_UTC9 2017/01/06 01:22:22 Good pattern!
20 test(function () {
21 assert_unreached();
22 }, 'This test requires eventSender');
23 return;
24 }
25
26 test(function () {
27 let textarea = document.getElementById('textarea');
28 textarea.focus();
29 textarea.setSelectionRange(10, 10);
30 eventSender.keyDown(' ');
31 assert_equals(textarea.value, '12345 \n 67', 'Line break should be inser ted automatically');
32 }, 'Typing space at the start of wrapped line in textarea');
33
34 test(function () {
35 let editor = document.getElementById('plaintext');
36 let textNode = editor.firstChild;
37 window.getSelection().setBaseAndExtent(textNode, 10, textNode, 10);
38 eventSender.keyDown(' ');
39 assert_equals(editor.textContent, '12345 \n 67', 'Line break should be i nserted automatically');
40 }, 'Typing space at the start of wrapped line in plaintext-only');
41
42 test(function () {
43 let editor = document.getElementById('richedit');
44 let textNode = editor.firstChild;
45 window.getSelection().setBaseAndExtent(textNode, 10, textNode, 10);
46 eventSender.keyDown(' ');
47 assert_equals(editor.textContent, '12345 67', 'Line break should NOT be inserted automatically');
48 }, 'Typing space at the start of wrapped line in contenteditable');
49 })();
50 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/Editor.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698