Closed Bug 441530 Opened 16 years ago Closed 16 years ago

Toolkit autocomplete sets the "nomatch" attribute on the popup rather than the textbox

Categories

(Toolkit :: Autocomplete, defect, P2)

defect

Tracking

()

RESOLVED FIXED
mozilla1.9.1a1

People

(Reporter: standard8, Assigned: standard8)

References

()

Details

Attachments

(1 file, 2 obsolete files)

See the url, when setting the "nomatch" attribute, toolkit's autocomplete sets it on the popup, rather than the textbox/autocomplete element. This basically makes the action useless as if there are no matches then there won't be a popup. See also http://mxr.mozilla.org/seamonkey/search?string=nomatch for current uses (none). This is needed for a nice implementation of bug 441526.
Attached patch The fix and test (obsolete) (deleted) — Splinter Review
This moves the attribute setting from the popup to the main autocomplete element. Test included to ensure correct functionality. I'll probably be extending the test in bug 441526 which is why I named it generically.
Attachment #326530 - Flags: review?
Attachment #326530 - Flags: review? → review?(mconnor)
Comment on attachment 326530 [details] [diff] [review] The fix and test I won't have time to look at this soon, punting to Enn
Attachment #326530 - Flags: review?(mconnor) → review?(enndeakin)
Priority: -- → P2
Comment on attachment 326530 [details] [diff] [review] The fix and test >+netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); This is a chrome test. Why are you asking for privileges throughout this test? >+ is(autocomplete.hasAttribute("nomatch"), false); There should be a description of the test as the third argument. Similarly for the other 'is' calls. >+ is(autocomplete.hasAttribute("nomatch"), true); >+ is(autocomplete.getAttribute("nomatch"), "true"); Save time and just check the second case only.
Attachment #326530 - Flags: review?(enndeakin) → review+
Attached patch The fix and test v2 (obsolete) (deleted) — Splinter Review
I addressed Neil's comments and this is what I have checked in.
Attachment #326530 - Attachment is obsolete: true
Attachment #329304 - Flags: review+
I checked this in earlier today and had to back it out again due to memory leaks. I think the problem was to do with how I was handling the component registration within the chrome level tests. I have an alternative way that I am currently testing.
Attached patch The fix and test v3 (deleted) — Splinter Review
When I checked in the previous version it turned the tinderboxes orange due to a memory leak, I investigated and it was due to having the result being created inline in the startSearch function, as http://developer.mozilla.org/en/docs/Using_XPCOM_in_JavaScript_without_leaking#Things_not_to_do suggests. So I have moved it to outside and created it as an object, and the test no longer leaks. Requesting review again as the test has changed slightly from what it was.
Attachment #329304 - Attachment is obsolete: true
Attachment #329832 - Flags: review?(enndeakin)
Attachment #329304 - Attachment description: [checked in] The fix and test v2 → The fix and test v2
Comment on attachment 329832 [details] [diff] [review] The fix and test v3 >+nsAutoCompleteSimpleResult.prototype = { >+ _param: null, Did you mean "" here?
Attachment #329832 - Flags: review?(enndeakin) → review+
(In reply to comment #7) > (From update of attachment 329832 [details] [diff] [review]) > >+nsAutoCompleteSimpleResult.prototype = { > >+ _param: null, > > Did you mean "" here? > Patch checked in with this fixed.
Status: NEW → RESOLVED
Closed: 16 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.1a1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: