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

Side by Side Diff: LayoutTests/editing/undo/undo-set-selection-crash.html

Issue 326323003: Fix a crash caused by invalid selection set by Undo command. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix minor issues in test. Created 6 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/editing/undo/undo-set-selection-crash-expected.txt » ('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 <html>
3 <head>
4 <script src="../../resources/js-test.js"></script>
5 </head>
6 <body>
7 <div id="test-div" contentEditable="true"><select></select></div>
8 <script>
9 description('Undo command should not make a selection anchored in another docume nt.');
10
11 window.jsTestIsAsync = true;
12
13 var div = document.getElementById('test-div');
14 var selection = window.getSelection();
15
16 div.focus();
17 document.execCommand('SelectAll');
18 document.execCommand('Indent');
19 document.execCommand('Outdent');
20
21 var anotherDocument = document.implementation.createHTMLDocument('');
22 anotherDocument.body.appendChild(selection.getRangeAt(0).extractContents());
23
24 div.contentEditable = false;
25
26 document.execCommand('Undo');
27 document.execCommand('FindString', false, 'x');
28
29 window.setTimeout(function () {
30 document.body.removeChild(div);
31 testPassed('Did not crash.');
32 finishJSTest();
33 }, 0);
34 </script>
35 </body>
36 </html>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/undo/undo-set-selection-crash-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698