зеркало из https://github.com/mozilla/gecko-dev.git
Bug 163905. [typeaheadfind] F3 hangs browser after selection returns to normal color. r=kyle, sr=alecf. Bug 163913: [typeaheadfind] status messages no longer displayed. r=kyle, sr=alecf
This commit is contained in:
Родитель
dccf20a93b
Коммит
cba24542ca
|
@ -0,0 +1,19 @@
|
||||||
|
<?xml version="1.0"?>
|
||||||
|
<RDF:RDF xmlns:RDF="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:chrome="http://www.mozilla.org/rdf/chrome#">
|
||||||
|
|
||||||
|
<!-- list all the packages being supplied -->
|
||||||
|
<RDF:Seq about="urn:mozilla:package:root">
|
||||||
|
<RDF:li resource="urn:mozilla:package:typeaheadfind"/>
|
||||||
|
</RDF:Seq>
|
||||||
|
|
||||||
|
<!-- package information -->
|
||||||
|
<RDF:Description about="urn:mozilla:package:typeaheadfind"
|
||||||
|
chrome:displayName="Type Ahead Find"
|
||||||
|
chrome:author="mozilla.org"
|
||||||
|
chrome:name="typeaheadfind"
|
||||||
|
chrome:localeVersion="1.1b">
|
||||||
|
</RDF:Description>
|
||||||
|
|
||||||
|
</RDF:RDF>
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
typeaheadfind.jar:
|
typeaheadfind.jar:
|
||||||
locale/en-US/typeaheadfind/contents.rdf (locale/en-US/contents.rdf)
|
locale/en-US/typeaheadfind/contents.rdf (locale/en-US/contents.rdf)
|
||||||
locale/en-US/typeaheadfind/typeaheadfind.properties (locale/en-US/typeaheadfind.properties)
|
locale/en-US/typeaheadfind/typeaheadfind.properties (locale/en-US/typeaheadfind.properties)
|
||||||
|
content/typeaheadfind/contents.rdf (content/contents.rdf)
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,10 @@
|
||||||
</RDF:Seq>
|
</RDF:Seq>
|
||||||
|
|
||||||
<!-- locale information -->
|
<!-- locale information -->
|
||||||
<RDF:Description about="urn:mozilla:locale:en-US">
|
<RDF:Description about="urn:mozilla:locale:en-US"
|
||||||
|
chrome:displayName="English (US)"
|
||||||
|
chrome:author="mozilla.org"
|
||||||
|
chrome:name="en-US">
|
||||||
<chrome:packages>
|
<chrome:packages>
|
||||||
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
<RDF:Seq about="urn:mozilla:locale:en-US:packages">
|
||||||
<RDF:li resource="urn:mozilla:locale:en-US:typeaheadfind"/>
|
<RDF:li resource="urn:mozilla:locale:en-US:typeaheadfind"/>
|
||||||
|
@ -16,6 +19,6 @@
|
||||||
</chrome:packages>
|
</chrome:packages>
|
||||||
|
|
||||||
<RDF:Description about="urn:mozilla:locale:en-US:typeaheadfind"
|
<RDF:Description about="urn:mozilla:locale:en-US:typeaheadfind"
|
||||||
chrome:localeVersion="1.0.0"/>
|
chrome:localeVersion="1.1b"/>
|
||||||
</RDF:RDF>
|
</RDF:RDF>
|
||||||
|
|
||||||
|
|
|
@ -842,24 +842,33 @@ nsTypeAheadFind::KeyPress(nsIDOMEvent* aEvent)
|
||||||
// ----- Nothing found -----
|
// ----- Nothing found -----
|
||||||
DisplayStatus(PR_FALSE, nsnull, PR_FALSE); // Display failure status
|
DisplayStatus(PR_FALSE, nsnull, PR_FALSE); // Display failure status
|
||||||
|
|
||||||
|
mRepeatingMode = eRepeatingNone;
|
||||||
|
if (!isBackspace) {
|
||||||
|
// Error beep (don't been when backspace is pressed, they're
|
||||||
|
// trying to correct the mistake!)
|
||||||
nsCOMPtr<nsISound> soundInterface =
|
nsCOMPtr<nsISound> soundInterface =
|
||||||
do_CreateInstance("@mozilla.org/sound;1");
|
do_CreateInstance("@mozilla.org/sound;1");
|
||||||
|
|
||||||
if (soundInterface) {
|
if (soundInterface) {
|
||||||
soundInterface->Beep();
|
soundInterface->Beep();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Remove bad character from buffer, so we can continue typing from
|
// Remove bad character from buffer, so we can continue typing from
|
||||||
// last matched character
|
// last matched character
|
||||||
|
|
||||||
#ifdef DONT_ADD_CHAR_IF_NOT_FOUND
|
|
||||||
// If first character is bad, flush it away anyway
|
// If first character is bad, flush it away anyway
|
||||||
if (mTypeAheadBuffer.Length == 1)
|
#ifdef TYPEAHEADFIND_REMOVE_ALL_BAD_KEYS
|
||||||
|
// Remove all bad characters
|
||||||
|
if (mTypeAheadBuffer.Length() >= 1 && !isBackspace) {
|
||||||
|
#else
|
||||||
|
// Remove bad *first* characters only
|
||||||
|
if (mTypeAheadBuffer.Length() == 1 && !isBackspace) {
|
||||||
#endif
|
#endif
|
||||||
// Note the if above inside the #ifdef!
|
// Notice if () in #ifdef above!
|
||||||
mTypeAheadBuffer = Substring(mTypeAheadBuffer, 0,
|
mTypeAheadBuffer = Substring(mTypeAheadBuffer, 0,
|
||||||
mTypeAheadBuffer.Length() - 1);
|
mTypeAheadBuffer.Length() - 1);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -968,6 +977,9 @@ nsTypeAheadFind::FindItNow(PRBool aIsRepeatingSameChar, PRBool aIsLinksOnly,
|
||||||
findBuffer = PromiseFlatString(mTypeAheadBuffer);
|
findBuffer = PromiseFlatString(mTypeAheadBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (findBuffer.IsEmpty())
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
while (PR_TRUE) { // ----- Outer while loop: go through all docs -----
|
while (PR_TRUE) { // ----- Outer while loop: go through all docs -----
|
||||||
while (PR_TRUE) { // === Inner while loop: go through a single doc ===
|
while (PR_TRUE) { // === Inner while loop: go through a single doc ===
|
||||||
mFind->Find(findBuffer.get(), mSearchRange, mStartPointRange,
|
mFind->Find(findBuffer.get(), mSearchRange, mStartPointRange,
|
||||||
|
|
Загрузка…
Ссылка в новой задаче