Closed Bug 480642 Opened 15 years ago Closed 13 years ago

entering http:// into address bar and hitting escape at suggestion pop down sets location to http:///

Categories

(Firefox :: Address Bar, defect)

defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: mozilla, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.6) Gecko/2009020911 Ubuntu/8.10 (intrepid) Firefox/3.0.6

With FF 3.0.6 in Ubuntu, if you type "http:", "http:/", or "http://" into the address bar, let the suggestions pop up, then hit escape, it turns into "http:///" in the address bar.

I cannot duplicate this on latest Firefox _2_ in Windows XP, FWIW.

Reproducible: Always

Steps to Reproduce:
1. Enter "http:", "http:/", or "http://" (without the quotes) in the address bar.
2. Wait for the suggestion bar to appear.
3. Hit escape
Actual Results:  
The contents of the address bar become "http:///:

Expected Results:  
The contents of the address bar remain unchanged.
I can reproduce on trunk. What happens is that when escape is pressed, the textValue property of the binding in urlbarBindings.xml is set with the value currently in the urlbar. The setter there tries to parse the URI using nsIOService::newURI. If it succeeds, the nsIURI.spec attribute is used to fill the urlbar. The cause of the issue is that this process can add trailing slashes:

for each (let u in ["foo", "ftp", "ftp:", "ftp://",
                    "http", "http:", "http:/", "http://", "http://foo",
                    "http://foo/", "http://foo/bar"]) {
    let spec = "<none>";
    try {
        spec = Cc["@mozilla.org/network/io-service;1"]
                 .getService(Ci.nsIIOService)
                 .newURI(u, null, null).spec;
    } catch(e) {}
    dump("Url: " + u + " -> " + spec + "\n");
}

Url: foo -> <none>
Url: ftp -> <none>
Url: ftp: -> ftp:///
Url: ftp:// -> ftp:///
Url: http -> <none>
Url: http: -> http:///
Url: http:/ -> http:///
Url: http:// -> http:///
Url: http://foo -> http://foo/
Url: http://foo/ -> http://foo/
Url: http://foo/bar -> http://foo/bar
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Linux → All
Hardware: x86 → All
Version: unspecified → Trunk
(In reply to Sylvain Pasche from comment #1)

Still possible to reproduce through example, but I cannot reproduce in the location bar. So I am not sure how this bug affects any users.
Feel free to open a new bug Core :: Networking for comment #1
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
(In reply to Jesper Hansen from comment #3)
> (In reply to Sylvain Pasche from comment #1)
> 
> Still possible to reproduce through example, but I cannot reproduce in the
> location bar. So I am not sure how this bug affects any users.

Jesper, I can reproduce it in the location bar both as described here, and as described by me in 513557. This happens on FF8. You might want to reconsider fixing this bug (It seems to lack the right to do this).
(In reply to Strainu from comment #5)
> (In reply to Jesper Hansen from comment #3)
> > (In reply to Sylvain Pasche from comment #1)
> > 
> > Still possible to reproduce through example, but I cannot reproduce in the
> > location bar. So I am not sure how this bug affects any users.
> 
> Jesper, I can reproduce it in the location bar both as described here, and
> as described by me in 513557. This happens on FF8. You might want to
> reconsider fixing this bug (It seems to lack the right to do this).

The same in FF9.0.1
Can you reproduce this in safe mode?

(In reply to Jesper Hansen from comment #4)
No patch landed here, so this is definitively not "FIXED".
Resolution: FIXED → WORKSFORME
(In reply to Dão Gottwald [:dao] from comment #7)
> Can you reproduce this in safe mode?

Yes.
(In reply to Dão Gottwald [:dao] from comment #7)
> (In reply to Jesper Hansen from comment #4)
> No patch landed here, so this is definitively not "FIXED".

Errors are made when one does not check if the right option was made. 
Bug can indeed be reproduced in firefox 9, but not in trunk
This means that it should work in Aurora, right?
Not necessarily fixed in Aurora (ff11). But it might also already be fixed in beta (ff10).
We'll either see about ff10 on 31st January or if someone tests it before
You need to log in before you can comment on or make changes to this bug.