Caret skips blank line using down-arrow key in preformatted text (e.g. View Source). Bug 298690, patch by Uri Bernstein <uriber@gmail.com>, r+sr=roc

git-svn-id: svn://10.0.0.236/trunk@183253 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
smontagu%smontagu.org
2005-10-30 13:05:45 +00:00
parent 6a4ac2f0bc
commit a38b2c61f4
3 changed files with 14 additions and 19 deletions

View File

@@ -3292,18 +3292,14 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
if (!resultFrame->HasView())
{
rect = resultFrame->GetRect();
if (!rect.width || !rect.height)
result = NS_ERROR_FAILURE;
else {
nsIView* view;
nsPoint offset;
resultFrame->GetOffsetFromView(offset, &view);
result = resultFrame->GetContentAndOffsetsFromPoint(context,point - offset,
getter_AddRefs(aPos->mResultContent),
aPos->mContentOffset,
aPos->mContentOffsetEnd,
aPos->mPreferLeft);
}
nsIView* view;
nsPoint offset;
resultFrame->GetOffsetFromView(offset, &view);
result = resultFrame->GetContentAndOffsetsFromPoint(context,point - offset,
getter_AddRefs(aPos->mResultContent),
aPos->mContentOffset,
aPos->mContentOffsetEnd,
aPos->mPreferLeft);
if (NS_SUCCEEDED(result))
{
PRBool selectable;

View File

@@ -784,7 +784,7 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
return NS_OK;
}
if (line->mBounds.width == 0)
if (line->mBounds.width == 0 && line->mBounds.height == 0)
return NS_ERROR_FAILURE;
nsIFrame* frame = line->mFirstChild;

View File

@@ -3598,11 +3598,6 @@ nsTextFrame::GetPosition(nsPresContext* aPresContext,
// no need to worry about justification, that's always on the slow path
PrepareUnicodeText(tx, &indexBuffer, &paintBuffer, &textLength);
if (textLength <=0) {
//invalid frame to get position on
return NS_ERROR_FAILURE;
}
//IF STYLE SAYS TO SELECT TO END OF FRAME HERE...
PRInt32 prefInt =
nsContentUtils::GetIntPref("browser.drag_out_of_frame_style");
@@ -3624,7 +3619,11 @@ nsTextFrame::GetPosition(nsPresContext* aPresContext,
}
}
if (!outofstylehandled) //then we need to track based on the X coord only
if (textLength <= 0) {
aContentOffset = mContentOffset;
aContentOffsetEnd = aContentOffset;
}
else if (!outofstylehandled) //then we need to track based on the X coord only
{
//END STYLE IF
PRInt32* ip = indexBuffer.mBuffer;