Closed Bug 379763 Opened 18 years ago Closed 18 years ago

Need way to determine if a given element has an event handler of a certain type

Categories

(Core :: DOM: Events, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronlev, Assigned: smaug)

References

Details

(Keywords: access)

Attachments

(1 file, 1 obsolete file)

In order to fix bug 301621 I need a way, in C++, to determine if a given element has an onclick handler (assigned from JS). Eventually we'll be expanding this further, but for now onclick is enough. As it stands we only expose objects with an onclick action if it's an inline onclick="foo()". If this is very slow, another possibility is for us to just get a list of all the elements in the current document with an onclick handler, and then we can go create an accessible object for each. But that would make mozilla/accessible more complicated.
Note: it doesn't matter if it was added by JS or C++, or whatever.
Attached patch possible patchSplinter Review
Aaron, could you test this?
Attachment #263772 - Attachment is obsolete: true
Yes, it works great. I developed a patch based on it over in bug 301621 -- seeking your r= on that.
Attachment #263773 - Flags: superreview?(jst)
Attachment #263773 - Flags: review?(jst)
Comment on attachment 263773 [details] [diff] [review] possible patch Looks good to me.
Attachment #263773 - Flags: superreview?(jst)
Attachment #263773 - Flags: superreview+
Attachment #263773 - Flags: review?(jst)
Attachment #263773 - Flags: review+
Status: NEW → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: