Bug 298690: Caret skips blank line using down-arrow key in preformatted text (e.g. View Source). r+sr+a=roc

git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@191241 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
uriber%gmail.com
2006-02-25 16:08:05 +00:00
parent ee835b6f1d
commit c2682acaa0
3 changed files with 11 additions and 15 deletions

View File

@@ -3336,14 +3336,11 @@ nsFrame::GetNextPrevLineFromeBlockFrame(nsPresContext* aPresContext,
if (!resultFrame->HasView())
{
rect = resultFrame->GetRect();
if (!rect.width || !rect.height)
result = NS_ERROR_FAILURE;
else
result = resultFrame->GetContentAndOffsetsFromPoint(context,point,
getter_AddRefs(aPos->mResultContent),
aPos->mContentOffset,
aPos->mContentOffsetEnd,
aPos->mPreferLeft);
result = resultFrame->GetContentAndOffsetsFromPoint(context,point,
getter_AddRefs(aPos->mResultContent),
aPos->mContentOffset,
aPos->mContentOffsetEnd,
aPos->mPreferLeft);
if (NS_SUCCEEDED(result))
{
PRBool selectable;

View File

@@ -783,7 +783,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

@@ -3880,11 +3880,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;
}
nsPoint origin;
nsIView * view;
GetOffsetFromView(origin, &view);
@@ -3910,7 +3905,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;