Closed Bug 9595 Opened 27 years ago Closed 27 years ago

text/textarea.onselect does not work

Categories

(Core :: Layout: Form Controls, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: martin.honnen, Assigned: buster)

References

Details

Attachments

(1 file)

I don't get onselect fired for INPUT TYPE="text" and TEXTAREA elements. That is HTML4 so I file it on HTML forms but I think it applies to DOM level 0 and 1 as well. <HTML> <HEAD> <SCRIPT> var w; function debugOutput (t) { if (!window.w || window.w.closed) w = open ('about:blank', 'debug'); w.document.write(t); w.document.write('<HR>'); } </SCRIPT> </HEAD> <BODY> <FORM NAME="aForm"> <INPUT TYPE="text" NAME="aField" VALUE="Kibology" ONSELECT="debugOutput(event.type + ' for ' + event.target);" > <BR> <TEXTAREA NAME="aTextArea" ROWS="5" COLS="20" WRAP="off" ONSELECT="debugOutput(event.type + ' for ' + event.target);" > All for Kibology. </TEXTAREA> </FORM> </BODY> </HTML>
Assignee: karnaze → buster
Steve, reassign to pollmann if appropriate.
Status: NEW → ASSIGNED
Depends on: 7001
this is yet another problem due to focus events not propogating through webshells
now that focus issues are resolved, I have a selection listener that is all ready to fire OnSelect notifications. But it's unclear what event type (nsGUIEvent::message) I should use. Vidur, Rod, Kevin, any ideas? The code looks like this: NS_IMETHODIMP nsEnderSelectionListener::NotifySelectionChanged() { if (mFrame && mContent) { // Dispatch the event nsEventStatus status = nsEventStatus_eIgnore; nsGUIEvent event; event.eventStructType = NS_GUI_EVENT; event.widget = nsnull; event.message = NS_CONTROL_CHANGE; //XXX: this is the wrong type event.flags = NS_EVENT_FLAG_INIT; // Have the content handle the event. mContent->HandleDOMEvent(*mContext, &event, nsnull, NS_EVENT_FLAG_INIT, status); // Now have the frame handle the event mFrame->HandleEvent(*mContext, &event, status); } return NS_OK; }
I think you want to fire a NS_FORM_CHANGE not NS_CONTROL_CHANGE.
I use NS_FORM_CHANGE for OnChange notifications, and that seems to work fine. I don't think the same message will work for both. It's OnSelect notifications I'm after here.
cc'd joki. Tom, please look at the discussion in this bug and point us in the right direction. thanks!
I believe you need a new event. OnSelect really never worked in 4.0 and I don't think we've gotten around to hooking it up in Gecko so I don't even think an event exists. One would need to be added to the nsGUIEvent.h file.
Assignee: buster → joki
Status: ASSIGNED → NEW
reassigned to Joki. Sounds like you (or someone else you designate) needs to put the infrastructure in place for OnSelect. Once that's done, reassign this back to me and I'll finish hooking up the text control.
Just did some snooping with LXR. To implement this in a way parallel to onchange will require a bit of work. Here are the obvious places NS_FORM_CHANGE and onChange are present. I'm probably missing some, but these are starting points for where onSelect and possibly a NS_FORM_SELECT would need to be added: NS_FORM_CHANGE: layout/events/src/nsEventListenerManager::HandleEvent() widget/public/nsGUIEvent.h widget/src/xpwidgets/nsBaseWidget::GuiEventToString() layout/events/src/nsEventListenerManager::HandleEvent() layout/events/src/nsDOMEvent::GetEventName() layout/events/src/nsDOMEvent.h onChange: layout/html/base/src/nsHTMLAtomList.h layout/html/content/src/nsGenericHTMLElement::SetAttribute() layout/base/src/nsDocument::SetProperty() layout/base/src/nsGenericElement::SetProperty() ...plus, of course any frame code that generates the event.
Assignee: joki → buster
I've added the onselect event. It isn't currenly hooked up or fired at all. Reassigning to buster.
Status: NEW → RESOLVED
Closed: 27 years ago
Resolution: --- → FIXED
Target Milestone: M9
fixed. thanks to martin.honnen@sector27.de for creating a great little test case. To QA: use javascript: to view the output to verify onSelect notifications are getting fired.
QA Contact massive update.
Status: RESOLVED → VERIFIED
Tested with 10-09-09. Working perfect. Marking verified.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: