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

Side by Side Diff: LayoutTests/editing/deleting/5290534.html

Issue 258063005: Blink does not respect input.selectionStart and input.selectionEnd for some cases (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Addressing changes asked in previous patch Created 6 years, 5 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 <p>This tests for a crash when adding/removing content from a search field that is inside an editable region.</p> 1 <p>This tests for a crash when adding/removing content from a search field that is inside an editable region.</p>
2 2
3 <div contenteditable="true"><input id="search" type="search"></div> 3 <div contenteditable="true"><input id="search" type="search"></div>
4 <ul id="console"></ul> 4 <ul id="console"></ul>
5 5
6 <script> 6 <script>
7 function log(msg) 7 function log(msg)
8 { 8 {
9 li = document.createElement("li"); 9 li = document.createElement("li");
10 li.appendChild(document.createTextNode(msg)); 10 li.appendChild(document.createTextNode(msg));
11 document.getElementById("console").appendChild(li); 11 document.getElementById("console").appendChild(li);
12 } 12 }
13 13
14 if (window.testRunner) 14 if (window.testRunner)
15 window.testRunner.dumpAsText(); 15 window.testRunner.dumpAsText();
16 16
17 var search = document.getElementById("search"); 17 var search = document.getElementById("search");
18 search.setSelectionRange(0, 0); 18 search.focus();
19 document.execCommand("InsertText", false, "x"); 19 document.execCommand("InsertText", false, "x");
20 if (search.value != "x") 20 if (search.value != "x")
21 log("Failure: text wasn't added to the search field."); 21 log("Failure: text wasn't added to the search field.");
22 document.execCommand("Delete"); 22 document.execCommand("Delete");
23 if (search.value == "") 23 if (search.value == "")
24 log("Success! Test successfully removed text from the search field."); 24 log("Success! Test successfully removed text from the search field.");
25 </script> 25 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698