Bug 1407987 Part 1: Change isRangeVisible to only use isRangeRendered for text within the viewport. draft
authorBrad Werth <bwerth@mozilla.com>
Thu, 12 Oct 2017 15:49:18 -0700
changeset 681657 d67d908a0685c3e5331101e3434907a384dac141
parent 681625 f27105b62753c71ecadad2f8d632ec7e5ac96bbd
child 681658 f405ac6e800048f967ecde1a2148233b352f8ab9
child 681662 d2b1409cc29d64b8fa68aa96f94bde89c7b8138d
push id84896
push userbwerth@mozilla.com
push dateTue, 17 Oct 2017 16:52:28 +0000
bugs1407987
milestone58.0a1
Bug 1407987 Part 1: Change isRangeVisible to only use isRangeRendered for text within the viewport. MozReview-Commit-ID: BUlZ5SGTiSR
toolkit/components/typeaheadfind/nsTypeAheadFind.cpp
--- 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