202834 r=danm sr=kin fixes regression in line clicking and navigation.

This commit is contained in:
mjudge%netscape.com 2003-04-22 22:40:58 +00:00
Родитель 8f24979ea4
Коммит 0bc89daad7
2 изменённых файлов: 26 добавлений и 0 удалений

Просмотреть файл

@ -797,6 +797,7 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
return NS_ERROR_FAILURE;
nsRect r1, r2;
nsIFrame *stoppingFrame = nsnull;
if (aX < line->mBounds.x) {
nsIFrame* frame;
@ -814,6 +815,10 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
*aXIsAfterLastFrame = PR_FALSE;
return NS_OK;
}
else if (mRightToLeft)
stoppingFrame = frame;
else
stoppingFrame = line->LastChild();
}
else if (aX >= line->mBounds.XMost()) {
nsIFrame* frame;
@ -831,6 +836,10 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
*aXIsAfterLastFrame = PR_TRUE;
return NS_OK;
}
else if (mRightToLeft)
stoppingFrame = line->mFirstChild;
else
stoppingFrame = frame;
}
// Find the frame closest to the X coordinate. Gaps can occur
@ -884,6 +893,8 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
else
#endif // IBMBIDI
frame->GetNextSibling(&nextFrame);
if (nextFrame == stoppingFrame)
break;
frame->GetRect(r1);
if (r1.width && aX > r1.x) {
break;
@ -939,6 +950,8 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
else
#endif // IBMBIDI
frame->GetNextSibling(&nextFrame);
if (nextFrame == stoppingFrame)
break;
frame->GetRect(r1);
if (r1.width && aX < r1.XMost()) {
break;

Просмотреть файл

@ -797,6 +797,7 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
return NS_ERROR_FAILURE;
nsRect r1, r2;
nsIFrame *stoppingFrame = nsnull;
if (aX < line->mBounds.x) {
nsIFrame* frame;
@ -814,6 +815,10 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
*aXIsAfterLastFrame = PR_FALSE;
return NS_OK;
}
else if (mRightToLeft)
stoppingFrame = frame;
else
stoppingFrame = line->LastChild();
}
else if (aX >= line->mBounds.XMost()) {
nsIFrame* frame;
@ -831,6 +836,10 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
*aXIsAfterLastFrame = PR_TRUE;
return NS_OK;
}
else if (mRightToLeft)
stoppingFrame = line->mFirstChild;
else
stoppingFrame = frame;
}
// Find the frame closest to the X coordinate. Gaps can occur
@ -884,6 +893,8 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
else
#endif // IBMBIDI
frame->GetNextSibling(&nextFrame);
if (nextFrame == stoppingFrame)
break;
frame->GetRect(r1);
if (r1.width && aX > r1.x) {
break;
@ -939,6 +950,8 @@ nsLineIterator::FindFrameAt(PRInt32 aLineNumber,
else
#endif // IBMBIDI
frame->GetNextSibling(&nextFrame);
if (nextFrame == stoppingFrame)
break;
frame->GetRect(r1);
if (r1.width && aX < r1.XMost()) {
break;