Bug 1407987 Part 1: Change isRangeVisible to only use isRangeRendered for text within the viewport.
MozReview-Commit-ID: BUlZ5SGTiSR
--- a/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
+++ b/toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
@@ -1263,19 +1263,19 @@ nsTypeAheadFind::IsRangeVisible(nsIPresS
nsRectVisibility rectVisibility = nsRectVisibility_kAboveViewport;
if (!aGetTopVisibleLeaf && !frame->GetRect().IsEmpty()) {
rectVisibility =
aPresShell->GetRectVisibility(frame,
nsRect(nsPoint(0,0), frame->GetSize()),
minDistance);
- if (rectVisibility != nsRectVisibility_kAboveViewport) {
- // This is an early exit case, where we return true iff the range
- // is actually rendered.
+ if (rectVisibility == nsRectVisibility_kVisible) {
+ // This is an early exit case, where we return true if and only if
+ // the range is actually rendered.
return IsRangeRendered(aPresShell, aPresContext, aRange);
}
}
// Below this point, we know the range is not in the viewport.
if (!aMustBeInViewPort) {
// This is an early exit case because we don't care that that range