diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 68f5846a121..8ffb0e39618 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -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; diff --git a/mozilla/layout/generic/nsLineBox.cpp b/mozilla/layout/generic/nsLineBox.cpp index 3f933990a58..04988cdcdb9 100644 --- a/mozilla/layout/generic/nsLineBox.cpp +++ b/mozilla/layout/generic/nsLineBox.cpp @@ -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; diff --git a/mozilla/layout/generic/nsTextFrame.cpp b/mozilla/layout/generic/nsTextFrame.cpp index 71d600aa68e..5cab2c925dd 100644 --- a/mozilla/layout/generic/nsTextFrame.cpp +++ b/mozilla/layout/generic/nsTextFrame.cpp @@ -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;