зеркало из https://github.com/mozilla/pjs.git
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
This commit is contained in:
Родитель
bd65f6edd5
Коммит
b2d728da77
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Загрузка…
Ссылка в новой задаче