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

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

Issue 2270663002: Selection API of INPUT/TEXTAREA should not update FrameSelection without focusing. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Adjust more tests Created 4 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
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../resources/testharness.js"></script> 2 <script src="../../resources/testharness.js"></script>
3 <script src="../../resources/testharnessreport.js"></script> 3 <script src="../../resources/testharnessreport.js"></script>
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> 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>
5 <textarea id="textarea"></textarea> 5 <textarea id="textarea"></textarea>
6 <div id="log"></div> 6 <div id="log"></div>
7 <script> 7 <script>
8 textarea = document.getElementById("textarea"); 8 textarea = document.getElementById("textarea");
9 textarea.setSelectionRange(0, 0); 9 textarea.setSelectionRange(0, 0);
10 textarea.focus();
10 textarea.parentNode.removeChild(textarea); 11 textarea.parentNode.removeChild(textarea);
11 test(function() { 12 test(function() {
12 assert_equals(window.getSelection().type, 'Caret'); 13 assert_equals(window.getSelection().type, 'Caret');
13 assert_equals(window.getSelection().getRangeAt(0).startContainer, document.b ody); 14 assert_equals(window.getSelection().getRangeAt(0).startContainer, document.b ody);
14 assert_equals(window.getSelection().getRangeAt(0).startOffset, 2); 15 assert_equals(window.getSelection().getRangeAt(0).startOffset, 2);
15 }); 16 });
16 </script> 17 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698