From 0179ab3005c5f24d4ea75469f22cac92cc5f924c Mon Sep 17 00:00:00 2001 From: "jfrancis%netscape.com" Date: Tue, 12 Feb 2002 02:16:11 +0000 Subject: [PATCH] fix for bug 106855: Down arrow key at last empty line of textarea moves caret to end of line above. checked in on behalf of skamio@netscape.net. r=jfrancis; sr=kin --- layout/html/forms/src/nsGfxTextControlFrame2.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/layout/html/forms/src/nsGfxTextControlFrame2.cpp b/layout/html/forms/src/nsGfxTextControlFrame2.cpp index 397dbb2517a9..b82e8793d226 100644 --- a/layout/html/forms/src/nsGfxTextControlFrame2.cpp +++ b/layout/html/forms/src/nsGfxTextControlFrame2.cpp @@ -993,6 +993,7 @@ nsTextInputSelectionImpl::CompleteMove(PRBool aForward, PRBool aExtend) // make the caret be either at the very beginning (0) or the very end PRInt32 offset = 0; + HINT hint = HINTLEFT; if (aForward) { parentDIV->ChildCount(offset); @@ -1009,12 +1010,15 @@ nsTextInputSelectionImpl::CompleteMove(PRBool aForward, PRBool aExtend) nsCOMPtr tagName; result = child->GetTag(*getter_AddRefs(tagName)); if (NS_SUCCEEDED(result) && tagName.get() == nsHTMLAtoms::br) + { --offset; + hint = HINTRIGHT; // for Bug 106855 + } } } } - result = mFrameSelection->HandleClick(parentDIV, offset, offset, aExtend, PR_FALSE, aExtend); + result = mFrameSelection->HandleClick(parentDIV, offset, offset, aExtend, PR_FALSE, hint); // if we got this far, attempt to scroll no matter what the above result is return CompleteScroll(aForward);