Closed
Bug 739751
Opened 13 years ago
Closed 13 years ago
in-the-middle autocomplete unexpectedly appears in urlbar ("searchstring >> full string")
Categories
(Toolkit :: Autocomplete, defect)
Toolkit
Autocomplete
Tracking
()
RESOLVED
FIXED
mozilla14
People
(Reporter: Margaret, Assigned: mak)
References
(Depends on 1 open bug)
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
3.94 KB,
patch
|
Gavin
:
review+
|
Details | Diff | Splinter Review |
I find this happens with these same steps, regardless of search string/domain:
1) type a few characters (e.g. "dr")
2) press right arrow to autocomplete domain (results in "http://dropbox.com/" in urlbar)
3) press space (results in "http://dropbox.com/ >> dropbox.com/" in urlbar)
If I press the right arrow again (or press enter to submit the search) it does not replace my inital search string, it just searches for "http://dropbox.com/ >> dropbox.com/".
Assignee | ||
Comment 1•13 years ago
|
||
I'll start by making a testcase, though if anyone wants to steal this, it's free, I'm just assigning to not lose it.
Assignee: nobody → mak77
Assignee | ||
Comment 2•13 years ago
|
||
This is the first issue:
1. you are searching for "dropbox.com/ " where the actual value is "dropbox.com/". 2. The search trims the search term and returns "dropbox.com/"
3. nsAutoCompleteController::CompleteValue does a StringBeginsWith(aValue, mSearchString), this fails cause searchstring is longer
4. it then enters the else, that tries to extract a scheme, but we trimmed out http, so it just decides we are completing a simple word from the middle.
still investigating what happens when you confirm.
Assignee | ||
Comment 3•13 years ago
|
||
looks like we enter GetDefaultCompleteValue with aResultIndex == -1, we try to loop through mResults, but it's empty
Assignee | ||
Updated•13 years ago
|
Blocks: 566489
Keywords: regression
Assignee | ||
Comment 4•13 years ago
|
||
hm, nvm comment 3. in the end it's just that we add a match shorter than the searchstring and that confuses completeDefaultIndex.
Status: NEW → ASSIGNED
Assignee | ||
Comment 5•13 years ago
|
||
I think makes sense to avoid trying to inline autocomplete anything with spaces, since we are autocompleting urls, this ensures we don't end up uselessly tokenizing and then passing fancy results back to completeDefaultValue.
Attachment #610919 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 6•13 years ago
|
||
oops the comment was a bit unclean.
Attachment #610919 -
Attachment is obsolete: true
Attachment #610919 -
Flags: review?(gavin.sharp)
Attachment #610920 -
Flags: review?(gavin.sharp)
Comment 7•13 years ago
|
||
Comment on attachment 610920 [details] [diff] [review]
patch v1.1
>diff --git a/toolkit/components/places/nsPlacesAutoComplete.js b/toolkit/components/places/nsPlacesAutoComplete.js
>+ // Don't try to autofill if the search term includes any whitespace.
>+ // This may confuse completeDefaultIndex cause the MATCH_AUTOCOMPLETE
>+ // tokenizer ends up trimming the search string and returning a value
>+ // that doesn't match it, or is even shorter.
What is MATCH_AUTOCOMPLETE? This solution seems reasonable, but I have to admit I still don't fully understand the cause of the bug. Should we also have a more complete solution that fixes this problem more generally (in the controller?).
Attachment #610920 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 8•13 years ago
|
||
MATCH_AUTOCOMPLETE is a SQL function that takes search terms, tokenize them, and compare them to url, tags and title.
The controller is doing the right thing, it is passing us the search string, and would be wrong for it to strip spaces or tokenize, since it can't know what kind of resources the search is searching.
I don't think controller can make any assumption on the search, some search may want to retain and search for spaces.
The problem here is that the specific search applies transformation to the search string, and that transformation ends up returning a result that is shorter than the search string, that doesn't make sense.
Comment 9•13 years ago
|
||
Comment on attachment 610920 [details] [diff] [review]
patch v1.1
r=me with the comment fixed to mention AUTOCOMPLETE_MATCH
Attachment #610920 -
Flags: review+
Assignee | ||
Comment 10•13 years ago
|
||
fixed the comment and pushed
https://hg.mozilla.org/integration/mozilla-inbound/rev/a6527fdc59f4
Flags: in-testsuite+
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → mozilla14
Comment 11•13 years ago
|
||
seems to have caused a 12.1% regresssion of JM on kraken-astar
Comment 12•13 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•