Bug 600803 - setting value with newline on textarea has excess newline (test case); r=bzbarsky a=NPOTB

This commit is contained in:
Ehsan Akhgari 2010-10-07 15:54:33 -04:00
parent fc135a2458
commit 6217ae235e
3 changed files with 37 additions and 0 deletions

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<body onload="onLoad()">
<textarea></textarea>
<div id="start"></div>
<div id="end"></div>
<script>
function onLoad() {
var t = document.querySelector("textarea");
t.value = "Xaa\nbbb";
t.value = "aaa\nbbb\n";
t.value += "X";
document.getElementById("start").textContent = t.selectionStart;
document.getElementById("end").textContent = t.selectionEnd;
}
</script>
</body>
</html>

View File

@ -0,0 +1,18 @@
<!DOCTYPE html>
<html>
<body onload="onLoad()">
<textarea></textarea>
<div id="start"></div>
<div id="end"></div>
<script>
function onLoad() {
var t = document.querySelector("textarea");
t.value = "aaa\nbbb";
t.value = "aaa\nbbb\n";
t.value += "X";
document.getElementById("start").textContent = t.selectionStart;
document.getElementById("end").textContent = t.selectionEnd;
}
</script>
</body>
</html>

View File

@ -1511,3 +1511,4 @@ random-if(layersGPUAccelerated) == 581317-1.html 581317-1-ref.html
== 594624-1.html 594624-1-ref.html
== 597721-1.html 597721-1-ref.html
fails-if(!haveTestPlugin) == 599476.html 599476-ref.html
== 600803-1.html 600803-1-ref.html