Closed Bug 818263 Opened 7 years ago Closed 7 years ago

Make EventTarget binding work reliably for nodes

Categories

(Core :: DOM: Core & HTML, defect)

x86
macOS
defect
Not set

Tracking

()

RESOLVED FIXED
mozilla20

People

(Reporter: bzbarsky, Assigned: bzbarsky)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

In particular, nsINode does not inherit from nsDOMEventTargetHelper.  It sort of works out right this second because they have identical vtable layouts for the parts that matter, but relying on that is chancy.
Attachment #688480 - Flags: review?(peterv)
Attachment #688480 - Flags: review?(bugs)
Peter, is the castability bit at all right?  Or do I need to also implement QueryInterface on EventTarget?
Whiteboard: [need review]
Comment on attachment 688480 [details] [diff] [review]
Make the EventTarget binding work for nodes.



> #undef DOMCI_CASTABLE_INTERFACE
> #define DOMCI_CASTABLE_INTERFACES(_extra)                                     \
> DOMCI_CASTABLE_INTERFACE(nsINode, nsINode, 0, _extra)                         \
> DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::Element,  mozilla::dom::Element,\
>                                 1, _extra)                                    \
>+/* If this is ever removed, the IID for EventTarget can to go away */         \
>+DOMCI_CASTABLE_NODECL_INTERFACE(mozilla::dom::EventTarget,                    \
>+                                mozilla::dom::EventTarget, 2, _extra)         \
'can to go'?


> 'EventTarget': [
> {
>-    'nativeType': 'nsDOMEventTargetHelper',
>     'hasInstanceInterface': 'nsIDOMEventTarget',
>+    'hasXPConnectImpls': True,
>     'concrete': False,
>-    'prefable': True,
> },
I'm not familiar with this stuff
Attachment #688480 - Flags: review?(bugs) → review+
> 'can to go'?

Should be just "can go".  ;)  I'll fix.

> I'm not familiar with this stuff

Yeah, Peter can handle that end of it.
Try run looks ok.
Attachment #688480 - Flags: review?(peterv) → review+
https://hg.mozilla.org/integration/mozilla-inbound/rev/db4197606782
Flags: in-testsuite-
Whiteboard: [need review]
Target Milestone: --- → mozilla20
https://hg.mozilla.org/mozilla-central/rev/db4197606782
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Depends on: 832899
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.