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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/selection/5497643.html

Issue 1455413002: Make some editing layout test files to use w3c test harness (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2015-11-19T12:41:19 Created 5 years, 1 month 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
1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script>
1 <p>This tests to make sure that a selection inside a textarea is updated when th e textarea is removed from the document.</p> 4 <p>This tests to make sure that a selection inside a textarea is updated when th e textarea is removed from the document.</p>
2 <textarea id="textarea"></textarea> 5 <textarea id="textarea"></textarea>
6 <div id="log"></div>
3 <script> 7 <script>
4 if (window.testRunner)
5 window.testRunner.dumpAsText();
6 textarea = document.getElementById("textarea"); 8 textarea = document.getElementById("textarea");
7 textarea.setSelectionRange(0, 0); 9 textarea.setSelectionRange(0, 0);
8 textarea.parentNode.removeChild(textarea); 10 textarea.parentNode.removeChild(textarea);
9 if (window.getSelection().type == 'Caret' && 11 test(function() {
10 window.getSelection().getRangeAt(0).startContainer == document.body && 12 assert_equals(window.getSelection().type, 'Caret');
11 window.getSelection().getRangeAt(0).startOffset == 2) 13 assert_equals(window.getSelection().getRangeAt(0).startContainer, document.b ody);
12 alert("SUCCESS: Selection is set to position 2 of BODY.") 14 assert_equals(window.getSelection().getRangeAt(0).startOffset, 2);
13 else 15 });
14 alert("FAILURE: The selection is not set correctly after textarea was delete d.")
15 </script> 16 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698