This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
https://dom.spec.whatwg.org/#interface-nodefilter [[ callback interface NodeFilter ]] I think this is wrong, or at least confusing. Looking at https://heycam.github.io/webidl/#dfn-callback-interface, > Callback interfaces are ones that can be implemented by user objects and not by platform objects, as described in section 3.9 below. Also > Static attributes and static operations MUST NOT be defined on a callback interface. Which doesn't specifically call out `const`s, but seems the same in spirit. Additionally, while `window.NodeFilter` exists in all browsers, `window.EventListener` does not, and earlier the spec declares `callback interface EventListener` very similarly. I think (but am not sure) per WebIDL callback interfaces don't exist globally. Suggested correction, if I am understanding this correctly: - Add a separate `interface NodeFilter` that shows up on the global, has constants, and has an `acceptNode` method. - Add `callback interface NodeFilterCallback` that contains only `acceptNode` and is used by createNodeIterator and createTreeWalker. - Specify that passing a `NodeFilterCallback` (which could just be a plain function, per the definition of callback interfaces) to e.g. createNodeIterator causes the creation of a new `NodeFilter` object that is reflected by the `filter` property of the created node iterator. Does this make sense? Am I on to something or just missing the idea entirely?
> Which doesn't specifically call out `const`s, but seems the same in spirit. It doesn't call them out because they're allowed on callback interfaces. > I think (but am not sure) per WebIDL callback interfaces don't exist globally. http://heycam.github.io/webidl/#es-interfaces is pretty clear on this: they exist if they have constants.
Ah OK. Thanks for catching me! (It would be really nice if the ES mapping was not so separated from the definition -_-)
Yeah, this split between "es bindings" and "language-independent stuff" is annoying. :(