IDL language bindings.
The link in the post is to a DOM2 specification of an "EventTarget" interface, written in IDL ("Interface Definition Language"). As a definition language, IDL describes what must be provided in a an interface written in a real language such as JavaScript, Java, MicoSoft Visual Basic for applications, or C++ for example.
"this interface can be obtained by using binding-specific casting methods on an instance of the Node interface."
is a technical way of saying "use the methods and properties documented for the language you are using, on a DOM node, rather than the exact wording of the specification provided here. The most binding we are most familiar with in web pages is, of course, for JavaScript. "Casting methods" may refer to how the implementation would automatically perform conversions between programming language and the DOM as required - e.g. converting JavaScript numbers to and from integer representations in some DOM attributes.
EventTargetPrototype
In Firefox this in object in the prototype chain of DOM nodes containing addEventListener
and associated functions. Again it Firefox you can access it as
Object.getPrototypeOf( Node.prototype))
and then create an object prototyped on it, using
Object.create(Object.getPrototypeOf( Node.prototype))
This didn't work for dispatching events however. It seems additional support ( perhaps the Node interface as well?) is required. Using a HTMLSpanElement
for the target "node object" worked in Firefox for dispatching and listening to an event without adding it to the DOM:
let a = document.createElement("SPAN");
a.addEventListener( "custom", function() {console.log("wow");}, false);
a.dispatchEvent( new CustomEvent("custom"));
Would I use this in production code? Definitely not. Except if thousands had tested it before me, in every browser type I might wish to support!