Closed Bug 281859 Opened 20 years ago Closed 18 years ago

Autocomplete widget caches key event

Categories

(Toolkit :: Autocomplete, defect, P3)

defect

Tracking

()

RESOLVED WONTFIX
mozilla1.8beta1

People

(Reporter: bugs, Assigned: bugs)

References

Details

If the user is typing something in an autocomplete text box and hits the enter
key before the autocomplete search which was initiated by the beginning of text
input has finished, the enter key event is cached by the widget. 

Unfortunately the DOM event which is cached refers to a nsEvent which is stack
allocated, so that when event dispatch completes it goes away. This does not
appear to be a problem for most autocomplete implementations in Firefox at
present because all of them happen pretty much synchronously (e.g. history lookup). 

The problem comes when you use an async lookup that requires network activity
which will not lock the UI - e.g. LDAP or something like that - by the time the
search finishes the cached event now points to random bits. The effect is that
that event cannot be fired and expect reliable things to happen. 

The autocomplete widget needs to cache the metadata that describe the key event,
and then create a new key event when the search completes and dispatch it.
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.8beta1
...or we could make nsDOMEvent not suck at some point...
Note that this actually came up on www-svg recently; the point was made that an
event object doesn't really have defined behavior once event dispatch is
complete.  I agree that nsDOMEvent sucks, but why is this code caching
nsDOMEvents exactly?
Because nsDOMEvent::DuplicatePrivateData() is now implemented in 1.8.1 and
trunk, there is no need to change autocomplete widget.
Depends on: 234455, 339697, 339774
So I'd say WONTFIX
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.