Closed Bug 7292 Opened 26 years ago Closed 25 years ago

JS handler should get called when label is clicked (radio/checkbox)

Categories

(Core :: DOM: UI Events & Focus Handling, defect, P3)

defect

Tracking

()

VERIFIED DUPLICATE of bug 7554

People

(Reporter: Brade, Assigned: joki)

Details

(Whiteboard: [TESTCASE][FIX])

Attachments

(1 file)

When the user clicks on a label which is associated with a radio button or a checkbox, the onclick handler should get fired.
Component: Widget Set → Event Handling
QA Contact: phillip → desale
reset QA Contact per beppe
Whiteboard: [MAKINGTEST] -- run2000@geocities.com
Whiteboard: [MAKINGTEST] -- run2000@geocities.com → [TESTCASE]
OS: Mac System 8.5 → All
Hardware: Macintosh → All
Whiteboard: [TESTCASE] → [TESTCASE][FIX]
Tom, here's a fix for ya'. I wonder if you could look it over, to see if it's kosher? If so, I can just check it in, since it's already in my tree. :) Index: nsHTMLLabelElement.cpp =================================================================== RCS file: /cvsroot/mozilla/layout/html/content/src/nsHTMLLabelElement.cpp,v retrieving revision 1.15 diff -r1.15 nsHTMLLabelElement.cpp 31a32,33 > #include "nsIDocument.h" > #include "nsIDOMHTMLDocument.h" 296c298 < return mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent, --- > nsresult rv = mInner.HandleDOMEvent(aPresContext, aEvent, aDOMEvent, 297a300,328 > if (NS_SUCCEEDED(rv)) { > nsAutoString elementId; > rv = GetHtmlFor(elementId); > if (NS_SUCCEEDED(rv)) { > nsIDocument* doc = nsnull; > rv = mInner.GetDocument(doc); // Strong > if (NS_SUCCEEDED(rv)) { > nsIDOMHTMLDocument* htmldoc = nsnull; // Strong > rv = doc->QueryInterface(nsIDOMHTMLDocument::GetIID(),(void**)&htmldoc); > if (NS_SUCCEEDED(rv)) { > nsIDOMElement* element = nsnull; // Strong > rv = htmldoc->GetElementById(elementId, &element); > if (NS_SUCCEEDED(rv)) { > nsIContent* content = nsnull; // Strong > rv = element->QueryInterface(nsIContent::GetIID(),(void**)&content); > if (NS_SUCCEEDED(rv)) { > content->HandleDOMEvent(aPresContext, aEvent, aDOMEvent, > aFlags, aEventStatus); > NS_RELEASE(content); > } > NS_RELEASE(element); > } > NS_RELEASE(htmldoc); > } > NS_RELEASE(doc); > } > } > } > return rv; 299d329 <
If I ever finish moving all of the form element event handling code from the frames to the content as Rod suggested, this would make the label frame pretty thin! :)
*** This bug has been marked as a duplicate of 7554 ***
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → DUPLICATE
Brade do you want to verify this one ?
Status: RESOLVED → VERIFIED
Component: Event Handling → User events and focus handling
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: