Backed out changeset 1d664865e8e2 (bug 1302470)

--HG--
extra : rebase_source : 01a2d19ca9bef74f9fc8d8d69f5a06b0c0d1449c
This commit is contained in:
Carsten "Tomcat" Book 2017-04-21 17:10:43 +02:00
Родитель f2ec94ec8a
Коммит a2d0d81548
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();