Closed Bug 203754 Opened 21 years ago Closed 21 years ago

Bug in select code in Auto-Complete component

Categories

(Firefox :: Address Bar, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED

People

(Reporter: eric, Assigned: hewitt)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030423 Mozilla Firebird/0.6
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4a) Gecko/20030423 Mozilla Firebird/0.6

The AutoCompleteController seems to have a bug in the Select code that seems to
be due to a change in how the input controller works (the selecting worked once).

it seems that mInput->SelectTextRange() doesn't like "-1" as the end offset anymore.

Reproducible: Always

Steps to Reproduce:
1. set completedefaultindex="true" in the urlbar in browser.xul
2. type something into the browser urlbar that doesn't start with "http://"
3. see results

Actual Results:  
none of the text is selected

Expected Results:  
the text that wasn't typed in should be selected.

I'll add the patch once i submit the bug.
Attached patch Patch to fix problem (obsolete) — Splinter Review
This seems to fix the problem.
Attachment #121989 - Flags: review?(hewitt)
Blocks: 203756
I'll confirm this one and bug #203756 so the devs can have a look on it...

=> confirming and setting All/All
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Taking QA. Sorry for the bugspam
QA Contact: asa → davidpjames
Does this also fix the bug (at least I think it's a bug) where the cursor is
positioned at the start of the url bar instead of the end?
no. i don't believe i've seen that behaviour.
That must be a different bug.  If you arrow-down through the items in the
suggested matches dropdown, the cursor moves to the start of the url bar.  It
used to, I'm sure, move to the end.  Maybe that was an intended change, but I
can't see why it would be.
oh, yes, i believe this fixes that as well.
This also fixes a problem where when using CompleteDefaultIndex, if you select
the end of a url and hit delete, the end of the url re-appears.

This now initializes mSearchString so the Backspaced check in HandleText() will
fire correctly.
Attachment #121989 - Attachment is obsolete: true
Comment on attachment 129372 [details] [diff] [review]
Improved patch to fix

please review.
Attachment #129372 - Flags: review?(hewitt)
Checked in.  Thanks Eric.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Summary: Bug in select code in Auto-Complete component → Bug in select code in Auto-Complete component
Hmmm... I can't verify this because I don't understand what the problem was to
begin with. I got lost at step 1 in comment #0 :(. Where would I set that?
chrome://browser/content/browser.xul ? But that doesn't make any sense to me.
this did fix the problem.

the easiest way to turn this on would be to apply the patch in bug 203756 (which
adds a config option to turn "completedefaultindex" on and off).
Ok, I think I understand now - this was essentially an enabling bug to allow
another bug to be fixed. Fair enough.

verifying fixed as per reporter's confirmation; comment 12
Status: RESOLVED → VERIFIED
Attachment #121989 - Flags: review?(hewitt)
Attachment #129372 - Flags: review?(hewitt)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: