зеркало из https://github.com/mozilla/pjs.git
Bug 30088. Type ahead find extension, fixing timeouts so that are reset on failed matches as well. Not part of build
This commit is contained in:
Родитель
f41032f4eb
Коммит
f7b52a47ea
|
@ -564,6 +564,15 @@ NS_IMETHODIMP nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
|
||||||
|
|
||||||
gIsFindingText = PR_TRUE; // prevents listener callbacks from resetting us during typeahead find processing
|
gIsFindingText = PR_TRUE; // prevents listener callbacks from resetting us during typeahead find processing
|
||||||
nsresult rv = FindItNow(isLinksOnly, isFirstVisiblePreferred, isBackspace);
|
nsresult rv = FindItNow(isLinksOnly, isFirstVisiblePreferred, isBackspace);
|
||||||
|
|
||||||
|
// ------- If accessibility.typeaheadfind.timeout is set, cancel find after specified # milliseconds
|
||||||
|
if (mTimeoutLength) {
|
||||||
|
if (!mTimer)
|
||||||
|
mTimer = do_CreateInstance("@mozilla.org/timer;1");
|
||||||
|
if (mTimer)
|
||||||
|
mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), mTimeoutLength);
|
||||||
|
}
|
||||||
|
|
||||||
gIsFindingText = PR_FALSE;
|
gIsFindingText = PR_FALSE;
|
||||||
|
|
||||||
if (NS_SUCCEEDED(rv)) {
|
if (NS_SUCCEEDED(rv)) {
|
||||||
|
@ -590,13 +599,6 @@ NS_IMETHODIMP nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
|
||||||
mFindService->SetFindBackwards(PR_FALSE);
|
mFindService->SetFindBackwards(PR_FALSE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------- If accessibility.typeaheadfind.timeout is set, cancel find after specified # milliseconds
|
|
||||||
if (mTimeoutLength) {
|
|
||||||
if (!mTimer)
|
|
||||||
mTimer = do_CreateInstance("@mozilla.org/timer;1");
|
|
||||||
if (mTimer)
|
|
||||||
mTimer->Init(NS_STATIC_CAST(nsITimerCallback*, this), mTimeoutLength);
|
|
||||||
}
|
|
||||||
if (mTypeAheadBuffer.Length() == 1) { // If first letter, store where the first find succeeded (mStartFindRange)
|
if (mTypeAheadBuffer.Length() == 1) { // If first letter, store where the first find succeeded (mStartFindRange)
|
||||||
mStartFindRange = nsnull;
|
mStartFindRange = nsnull;
|
||||||
nsCOMPtr<nsIDOMRange> startFindRange;
|
nsCOMPtr<nsIDOMRange> startFindRange;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче