Closed
Bug 309273
(hasEventListenerNS)
Opened 19 years ago
Closed 12 years ago
Implement nsIDOM3EventTarget::hasEventListenerNS()
Categories
(Core :: DOM: Events, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: janv, Assigned: janv)
References
()
Details
(Whiteboard: Should support the standard versions!)
Attachments
(1 file, 1 obsolete file)
|
9.02 KB,
patch
|
ian
:
review-
peterv
:
superreview+
|
Details | Diff | Splinter Review |
We need this for one of our customers.
| Assignee | ||
Comment 1•19 years ago
|
||
Attachment #196759 -
Flags: superreview?(peterv)
Attachment #196759 -
Flags: review?(peterv)
| Assignee | ||
Updated•19 years ago
|
Attachment #196759 -
Attachment is obsolete: true
Attachment #196759 -
Flags: superreview?(peterv)
Attachment #196759 -
Flags: review?(peterv)
| Assignee | ||
Updated•19 years ago
|
Status: NEW → ASSIGNED
OS: Linux → All
| Assignee | ||
Comment 2•19 years ago
|
||
Attachment #196765 -
Flags: superreview?(peterv)
Attachment #196765 -
Flags: review?(peterv)
Comment 3•19 years ago
|
||
I don't see this particular method in the W3C Note on DOM 3 Events... can you explain for me what this does?
| Assignee | ||
Updated•19 years ago
|
Comment 4•19 years ago
|
||
It was in an older draft: <http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/events.html#Events3-isRegisteredHere>. No longer in the current version I believe. I can not find the reason for it being removed.
Comment 5•19 years ago
|
||
Comment on attachment 196765 [details] [diff] [review] patch2 >Index: dom/src/base/nsDOMClassInfo.cpp >=================================================================== Don't you need to add DOM_CLASSINFO_MAP_ENTRY(nsIDOM3EventTarget) to Window, Text, Comment, CDataSection, ProcessingInstruction, XMLStylesheetProcessingInstruction, ChromeWindow, DOM_CLASSINFO_SVG_GRAPHIC_ELEMENT_MAP_ENTRIES, SVGSVGElement and SVGSymbolElement? >Index: content/base/src/nsDocument.cpp >=================================================================== >+nsDocument::IsRegisteredHere(const nsAString& aType, PRBool* _retval) Please make _retval aResult. >Index: content/base/src/nsGenericElement.cpp >=================================================================== >+nsDOMEventRTTearoff::IsRegisteredHere(const nsAString& aType, PRBool* _retval) Please make _retval aResult. >Index: content/events/src/nsEventListenerManager.cpp >=================================================================== >+nsEventListenerManager::IsRegisteredHere(const nsAString& aType, PRBool* _retval) Please make _retval aResult. >+ *_retval = (GetListenersByType(eEventArrayType_Hash, &key, PR_FALSE)) != nsnull; No need for the second set of parentheses.
Attachment #196765 -
Flags: superreview?(peterv)
Attachment #196765 -
Flags: superreview+
Attachment #196765 -
Flags: review?(peterv)
Attachment #196765 -
Flags: review+
| Assignee | ||
Comment 7•19 years ago
|
||
(In reply to comment #4) > It was in an older draft: > <http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/events.html#Events3-isRegisteredHere>. > No longer in the current version I believe. I can not find the reason for it > being removed. Yeah, it seems they removed it in the current draft. Anyway, this method can be very useful for some apps (e.g. document inspection, you can't just check for "on" + eventName, some event listeners can be registered dynamically) and I wanted to contribute it back to main mozilla tree.
Updated•19 years ago
|
Attachment #196765 -
Flags: review+ → review-
Comment 8•19 years ago
|
||
Woah woah woah. This method _does_ exist in DOM3 Events, it has just been renamed and had its semantics improved: http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-hasEventListenerNS http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-willTriggerNS I'd strongly like to encourage that we don't take this patch as is; we should instead support the standard methods here.
Whiteboard: Should support the standard versions!
| Assignee | ||
Comment 9•19 years ago
|
||
Ian, is this just about ranaming isRegisteredHere to hasEventListenerNS?
Comment 10•19 years ago
|
||
Ah, right, please rename it. The semantics didn't change as far as I can see.
Comment 11•19 years ago
|
||
It takes a different number of arguments. For now since we don't support namespaces on addEventListener you can just ignore the namespace argument (all event handlers will have namespace null, and so all of them should match regardless of the namespace, as I understand it). However, I would strongly recommend reading the spec, and making sure that what you are implementing matches the spec.
| Assignee | ||
Comment 12•19 years ago
|
||
addGroupedEventListener -> addEventListenerNS removeGroupedEventListener -> removeEventListenerNS canTrigger -> willTriggerNS isRegisteredHere -> hasEventListenerNS All new DOM3 methods now have |namespaceURI| as the first argument Methods addGroupedEventListener and removeGroupedEventListener are currently implemented in mozilla. canTrigger and isRegisteredHere are not. The semantics didn't change for isRegisteredHere/hasEventListenerNS See http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/events.html#Events3-isRegisteredHere http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-hasEventListenerNS The semantics did change for addGroupedEventListener/addEventListenerNS and removeGroupedEventListener/removeEventListenerNS See http://www.w3.org/TR/2002/WD-DOM-Level-3-Events-20020208/events.html#Events3-addGroupedEventListener http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-addEventListenerNS So it should be safe to rename canTrigger and isRegisteredHere and add implementation for isRegisteredHere based on my original patch.
| Assignee | ||
Comment 13•19 years ago
|
||
Btw, there was a bug about nsIDOM3EventTarget.idl being distributed in the SDK. Someone wanted to freeze this interface IIRC.
Updated•19 years ago
|
Flags: blocking1.9a1?
Updated•18 years ago
|
Flags: blocking1.9a1? → blocking1.9-
Comment 14•18 years ago
|
||
(In reply to comment #8) > Woah woah woah. This method _does_ exist in DOM3 Events, it has just been > renamed and had its semantics improved: > > http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-hasEventListenerNS > http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-willTriggerNS I can't find these methods in dom level3 events. Do they still exist?
Comment 15•18 years ago
|
||
per comment 12.
Alias: hasEventListenerNS
Summary: Implement nsIDOM3EventTarget::IsRegisteredHere() → Implement nsIDOM3EventTarget::hasEventListenerNS()
Updated•18 years ago
|
Comment 16•18 years ago
|
||
Alex, http://www.w3.org/TR/DOM-Level-3-Events/events.html#Events3-hasEventListenerNS link is broken
Comment 18•18 years ago
|
||
(In reply to comment #17) > oops, yeah, I don't see it either. WONTFIX? > I'd like to see this feature. It should help to fix bug 301621.
Updated•15 years ago
|
QA Contact: ian → events
Updated•12 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•