Open
Bug 721225
Opened 14 years ago
Updated 3 years ago
getTextValue is not guaranteed to return the same string that was set through setTextValue
Categories
(Toolkit :: Autocomplete, defect, P3)
Toolkit
Autocomplete
Tracking
()
REOPENED
People
(Reporter: mak, Unassigned)
References
Details
(Whiteboard: [inline-autocomplete:minor])
Attachments
(1 file)
6.66 KB,
patch
|
Details | Diff | Splinter Review |
We do things like this:
else if (shouldComplete) {
// We usually try to preserve the casing of what user has typed, but
// if he wants to autocomplete, we will replace the value with the
// actual autocomplete result.
// The user wants explicitely to use that result, so this ensures
// association of the result with the autocompleted text.
nsAutoString value;
nsAutoString inputValue;
input->GetTextValue(inputValue);
if (NS_SUCCEEDED(GetDefaultCompleteValue(-1, false, value)) &&
value.Equals(inputValue, nsCaseInsensitiveStringComparator())) {
input->SetTextValue(value);
input->SelectTextRange(value.Length(), value.Length());
}
unfortunately when we called setTextValue earlier, the urlbar binding decided to apply trimming to the url, removing "http://", now we compare with a result value that is not trimmed, and obviously this can't work.
Similar things may happen in other parts of the controller, where we compare GetTextValue to results values.
Reporter | ||
Comment 1•14 years ago
|
||
a possible approach:
- add a SetTextValue helper, that caches the value and then sets it
- replace all direct calls with the helper
- add a GetUnmodifiedTextValue helper that returns the cached value
- replace all getTextValue calls with GetUnmodifiedTextValue
Reporter | ||
Comment 2•14 years ago
|
||
possible patch, though I'm not extremely happy with it
Reporter | ||
Comment 3•14 years ago
|
||
as a side note, this bug hits us when the user types the same exact string found by the autocomplete, and he tries to confirm it. The controller would like to set proper casing according to the result, but it can't. It's a pretty edge-case, so low priority.
Reporter | ||
Updated•14 years ago
|
Whiteboard: [inline-autocomplete:minor]
Comment 4•7 years ago
|
||
Per policy at https://wiki.mozilla.org/Bug_Triage/Projects/Bug_Handling/Bug_Husbandry#Inactive_Bugs. If this bug is not an enhancement request or a bug not present in a supported release of Firefox, then it may be reopened.
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → INACTIVE
Reporter | ||
Updated•7 years ago
|
Status: RESOLVED → REOPENED
Priority: -- → P3
Resolution: INACTIVE → ---
Updated•3 years ago
|
Severity: normal → S3
You need to log in
before you can comment on or make changes to this bug.
Description
•