Closed
Bug 419656
Opened 17 years ago
Closed 17 years ago
Location bar instrumentation misses unencoded urls
Categories
(Firefox :: Address Bar, defect, P2)
Firefox
Address Bar
Tracking
()
RESOLVED
FIXED
Firefox 3 beta5
People
(Reporter: Mardak, Assigned: Mardak)
References
Details
(Whiteboard: [fixes bug 417441 and bug 415397])
Attachments
(1 file, 4 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
I just realized with bug 415460 and bug 419324 about not unescaping urls until the UI.. there's a problem with the instrumentation.
We give the autocomplete unescaped urls but the feedback mechanism is expecting escaped urls because it queries on the url string.
Assignee | ||
Updated•17 years ago
|
Flags: blocking-firefox3?
Assignee | ||
Comment 1•17 years ago
|
||
r?dietrich for the backend bit (1 line)
r?gavin for the autocomplete binding changes
Assignee: nobody → edilee
Status: NEW → ASSIGNED
Attachment #305788 -
Flags: review?(gavin.sharp)
Attachment #305788 -
Flags: review?(dietrich)
Assignee | ||
Comment 2•17 years ago
|
||
Basically, this patch gives the AutoCompleteResult an encoded url and the UI is in charge of displaying an unencoded one. So when the user selects an entry, the AutoCompleteController uses the Result's encoded url for feedback.
So we keep the invariant that URIs/specs are passed around as encoded, but are decoded for UI.
Comment 3•17 years ago
|
||
Heh, we keep missing this ...
Flags: blocking-firefox3? → blocking-firefox3+
Priority: -- → P2
Updated•17 years ago
|
Attachment #305788 -
Flags: review?(dietrich) → review+
Assignee | ||
Updated•17 years ago
|
Whiteboard: [has patch][needs review gavin]
Assignee | ||
Comment 4•17 years ago
|
||
This helps fix bug 415397 because the front-end will retain the escaped version of the url that the back-end expects when deleting.
Assignee | ||
Comment 5•17 years ago
|
||
Addresses gavin's comments from irc about unnecessary code for checking nsIURI, so I just inlined it instead. Also, there's a difference when unescaping between selecting an entry and showing it in the popup.
Also this will fix P2 blocking bug 417441 by not unescaping ascii characters when putting the value into the autocomplete textbox.
Attachment #305788 -
Attachment is obsolete: true
Attachment #306955 -
Flags: review?(gavin.sharp)
Attachment #305788 -
Flags: review?(gavin.sharp)
Assignee | ||
Updated•17 years ago
|
Whiteboard: [has patch][needs review gavin] → [has patch][needs review gavin][fixes bug 417441]
Comment 6•17 years ago
|
||
Comment on attachment 306955 [details] [diff] [review]
v2
>diff --git a/toolkit/content/widgets/autocomplete.xml b/toolkit/content/widgets/autocomplete.xml
> <property name="textValue"
> onget="return this.value;">
> <setter><![CDATA[
>+ // Unescape the value safely for using it to visit the page
>+ this.value = Components.classes["@mozilla.org/intl/texttosuburi;1"].
>+ getService(Components.interfaces.nsITextToSubURI).
>+ unEscapeNonAsciiURI("UTF-8", val);
I don't think this part belongs in the generic toolkit binding. Talked to Edward on IRC about putting this in urlbarbindings.xml.
Attachment #306955 -
Flags: review?(gavin.sharp) → review-
Assignee | ||
Comment 7•17 years ago
|
||
(In reply to comment #6)
> > <property name="textValue"
> >+ this.value = Components.classes["@mozilla.org/intl/texttosuburi;1"].
> >+ getService(Components.interfaces.nsITextToSubURI).
> >+ unEscapeNonAsciiURI("UTF-8", val);
> I don't think this part belongs in the generic toolkit binding. Talked to
> Edward on IRC about putting this in urlbarbindings.xml.
So I added an extra parameter to URLBarSetURI to force it to load the URI because otherwise, I had to do this.value = "" then trigger the input event to cause userTypedValue to become empty which would then cause URLBarSetURI to actually look at the uri.
But that's not fun because it causes the urlbar to temporarily be empty and have the favicon switch to the default.
Attachment #306955 -
Attachment is obsolete: true
Attachment #307884 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 8•17 years ago
|
||
Now with more try/catching for fallback.
Attachment #307884 -
Attachment is obsolete: true
Attachment #307958 -
Flags: review?(gavin.sharp)
Attachment #307884 -
Flags: review?(gavin.sharp)
Assignee | ||
Comment 9•17 years ago
|
||
This should also fix P3 blocking bug 415397.
Blocks: 415397
Whiteboard: [has patch][needs review gavin][fixes bug 417441] → [has patch][needs review gavin][fixes bug 417441 and bug 415397]
Comment 10•17 years ago
|
||
Comment on attachment 307958 [details] [diff] [review]
v3.1
>Index: browser/base/content/urlbarBindings.xml
>+ <property name="textValue"
>+ onget="return this.value;">
>+ <setter>
>+ <![CDATA[
>+ // Force load the value into the urlbar to get it unescaped
>+ try {
>+ URLBarSetURI(Cc["@mozilla.org/network/io-service;1"].
>+ getService(Ci.nsIIOService).
>+ newURI(val, null, null), true);
Put the URI in a temporary for readability?
Attachment #307958 -
Flags: review?(gavin.sharp) → review+
Updated•17 years ago
|
Whiteboard: [has patch][needs review gavin][fixes bug 417441 and bug 415397] → [has patch][fixes bug 417441 and bug 415397]
Assignee | ||
Comment 11•17 years ago
|
||
(In reply to comment #10)
> >+ URLBarSetURI(Cc["@mozilla.org/network/io-service;1"].
> >+ getService(Ci.nsIIOService).
> >+ newURI(val, null, null), true);
> Put the URI in a temporary for readability?
Sure can. URLBarSetURI(uri, true);
Attachment #307958 -
Attachment is obsolete: true
Assignee | ||
Comment 12•17 years ago
|
||
Checking in browser/base/content/browser.js;
/cvsroot/mozilla/browser/base/content/browser.js,v <-- browser.js
new revision: 1.1004; previous revision: 1.1003
done
Checking in browser/base/content/urlbarBindings.xml;
/cvsroot/mozilla/browser/base/content/urlbarBindings.xml,v <-- urlbarBindings.xml
new revision: 1.57; previous revision: 1.56
done
Checking in toolkit/components/places/src/nsNavHistoryAutoComplete.cpp;
/cvsroot/mozilla/toolkit/components/places/src/nsNavHistoryAutoComplete.cpp,v <-- nsNavHistoryAutoComplete.cpp
new revision: 1.47; previous revision: 1.46
done
Checking in toolkit/content/widgets/autocomplete.xml;
/cvsroot/mozilla/toolkit/content/widgets/autocomplete.xml,v <-- autocomplete.xml
new revision: 1.123; previous revision: 1.122
done
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Whiteboard: [has patch][fixes bug 417441 and bug 415397] → [fixes bug 417441 and bug 415397]
Target Milestone: --- → Firefox 3 beta5
You need to log in
before you can comment on or make changes to this bug.
Description
•