Backed out changeset a5a77d4a3cf3 (bug 1302470)

This commit is contained in:
Sebastian Hengst 2017-04-21 19:09:11 +02:00
Родитель e78736fcec
Коммит 3e0e5a51d2
1 изменённых файлов: 9 добавлений и 20 удалений

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

@ -1210,22 +1210,22 @@ nsTypeAheadFind::IsRangeVisible(nsIPresShell *aPresShell,
return false;
nsIFrame *frame = content->GetPrimaryFrame();
if (!frame) {
if (!frame)
return false; // No frame! Not visible then.
}
if (!frame->StyleVisibility()->IsVisible()) {
if (!frame->StyleVisibility()->IsVisible())
return false;
}
// Detect if we are _inside_ a text control, or something else with its own
// selection controller.
if (aUsesIndependentSelection) {
*aUsesIndependentSelection =
*aUsesIndependentSelection =
(frame->GetStateBits() & NS_FRAME_INDEPENDENT_SELECTION);
}
// ---- We have a frame ----
if (!aMustBeInViewPort)
return true; // Don't need it to be on screen, just in rendering tree
// Get the next in flow frame that contains the range start
int32_t startRangeOffset, startFrameOffset, endFrameOffset;
@ -1259,22 +1259,12 @@ nsTypeAheadFind::IsRangeVisible(nsIPresShell *aPresShell,
minDistance);
if (rectVisibility != nsRectVisibility_kAboveViewport) {
// This is an early exit case, where we return true iff the range
// is actually rendered.
return IsRangeRendered(aPresShell, aPresContext, aRange);
return true;
}
}
// 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
// is out of viewport, so we return that the range is "visible".
return true;
}
// The range isn't in the viewport, but we could scroll it into view.
// Move range forward to first visible point,
// We know that the target range isn't usable because it's not in the
// view port. Move range forward to first visible point,
// this speeds us up a lot in long documents
nsCOMPtr<nsIFrameEnumerator> frameTraversal;
nsCOMPtr<nsIFrameTraversal> trav(do_CreateInstance(kFrameTraversalCID));
@ -1288,9 +1278,8 @@ nsTypeAheadFind::IsRangeVisible(nsIPresShell *aPresShell,
false // aSkipPopupChecks
);
if (!frameTraversal) {
if (!frameTraversal)
return false;
}
while (rectVisibility == nsRectVisibility_kAboveViewport) {
frameTraversal->Next();