зеркало из https://github.com/mozilla/gecko-dev.git
Bug 202992: h or htt cut off in address bar autocomplete (adds :// to domain names starting with p or t), patch by Tom S. <toms@internode.on.net>, r=mconnor
This commit is contained in:
Родитель
c11d088e8d
Коммит
2063f369f4
|
@ -1166,13 +1166,23 @@ nsAutoCompleteController::CompleteDefaultIndex(PRInt32 aSearchIndex)
|
|||
nsresult
|
||||
nsAutoCompleteController::CompleteValue(nsString &aValue, PRBool selectDifference)
|
||||
{
|
||||
nsString::const_iterator start, end, iter;
|
||||
nsString::const_iterator start, end, iter, skip;
|
||||
PRInt32 startSelect, endSelect;
|
||||
|
||||
mSearchString.BeginReading(start);
|
||||
mSearchString.EndReading(end);
|
||||
PRBool searchScheme = FindInReadable(NS_LITERAL_STRING("://"), start, end);
|
||||
|
||||
aValue.BeginReading(start);
|
||||
aValue.EndReading(end);
|
||||
iter = start;
|
||||
|
||||
// Skip "://"-suffixed scheme unless explicitly searched for (bug 202992).
|
||||
if (!searchScheme) {
|
||||
skip = end;
|
||||
iter = FindInReadable(NS_LITERAL_STRING("://"), iter, skip) ? skip : start;
|
||||
}
|
||||
|
||||
FindInReadable(mSearchString, iter, end,
|
||||
nsCaseInsensitiveStringComparator());
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче