Bug 602130 - Caret positioned incorrectly in input[type=text] when hidden and redisplayed; r=bzbarsky a=blocking-final+

--HG--
extra : rebase_source : 673601ada34f5d1eefc61303f7420dd74363e2b3
This commit is contained in:
Ehsan Akhgari 2010-10-14 15:36:35 -04:00
parent df16cbf877
commit cc3a98796c
4 changed files with 23 additions and 2 deletions

View File

@ -1145,9 +1145,9 @@ nsTextEditorState::PrepareEditor(const nsAString *aValue)
rv = mBoundFrame->UpdateValueDisplay(PR_FALSE, PR_TRUE);
NS_ENSURE_SUCCESS(rv, rv);
} else {
if (aValue) {
if (aValue || !mEditorInitialized) {
// Set the correct value in the root node
rv = mBoundFrame->UpdateValueDisplay(PR_TRUE, PR_FALSE, aValue);
rv = mBoundFrame->UpdateValueDisplay(PR_TRUE, !mEditorInitialized, aValue);
NS_ENSURE_SUCCESS(rv, rv);
}

View File

@ -0,0 +1,6 @@
<!DOCTYPE html>
<html>
<body>
<input autofocus style="display:block">
</body>
</html>

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html class="reftest-wait">
<body>
<input onfocus="focused()" autofocus>
<script>
function focused() {
var i = document.querySelector("input");
i.style.display = "block";
document.offsetWidth;
document.documentElement.removeAttribute("class");
}
</script>
</body>
</html>

View File

@ -21,3 +21,4 @@ include xul/reftest.list
!= caret_on_textarea_lastline.html caret_on_textarea_lastline-ref.html
== input-text-onfocus-reframe.html input-text-onfocus-reframe-ref.html
== input-text-notheme-onfocus-reframe.html input-text-notheme-onfocus-reframe-ref.html
== caret_after_reframe.html caret_after_reframe-ref.html