Bug 1470861: Make nsFind::ResetAll reset mIterNode / mIterOffset too. r?mats
We do reset them implicitly next time we call Find(..), since we call
ResetAll() at the beginning of it, then NextNode(..), which unconditionally
overrides them, but this is clearer for the next thing I want to do.
MozReview-Commit-ID: 6OW8MfkftTM
--- a/toolkit/components/find/nsFind.cpp
+++ b/toolkit/components/find/nsFind.cpp
@@ -901,16 +901,18 @@ nsFind::GetBlockParent(nsINode* aNode)
}
// Call ResetAll before returning, to remove all references to external objects.
void
nsFind::ResetAll()
{
mIterator = nullptr;
mLastBlockParent = nullptr;
+ mIterNode = nullptr;
+ mIterOffset = -1;
}
#define NBSP_CHARCODE (CHAR_TO_UNICHAR(160))
#define IsSpace(c) (nsCRT::IsAsciiSpace(c) || (c) == NBSP_CHARCODE)
#define OVERFLOW_PINDEX (mFindBackward ? pindex < 0 : pindex > patLen)
#define DONE_WITH_PINDEX (mFindBackward ? pindex <= 0 : pindex >= patLen)
#define ALMOST_DONE_WITH_PINDEX (mFindBackward ? pindex <= 0 : pindex >= patLen - 1)