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

Side by Side Diff: LayoutTests/fast/events/key-events-in-editable-gridbox.html

Issue 870013003: Div having contentEditable and display:grid cannot be edited if it is empty. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch Created 5 years, 10 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 <style>
6 #target {
7 display: grid;
8 display: -webkit-grid;
9 }
10 </style>
11 <script>
12 var targetDiv;
13 function test()
14 {
15 targetDiv = document.getElementById('target');
16 targetDiv.focus();
17
18 // Move cursor to the end of line.
19 getSelection().modify('move', 'forward', 'lineboundary');
20
21 document.execCommand("insertText", false, "EST");
22 shouldBeEqualToString("targetDiv.innerText", "TEST");
23
24 document.execCommand("delete");
25 document.execCommand("delete");
26 document.execCommand("delete");
27 document.execCommand("delete");
28 document.execCommand("delete"); // Remove '\n'
29 shouldBeEmptyString("targetDiv.innerText");
30
31 document.execCommand("insertText", false, "TEST");
32 shouldBeEqualToString("targetDiv.innerText", "TEST");
33 }
34 </script>
35 </head>
36 <body onload="test()">
37 <div id="target" contentEditable>T</div>
38 </body>
39 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698