- From: <bugzilla@jessica.w3.org>
- Date: Wed, 29 Oct 2014 17:29:35 +0000
- To: www-dom@w3.org
https://www.w3.org/Bugs/Public/show_bug.cgi?id=27191
Bug ID: 27191
Summary: "callback interface NodeFilter"
Product: WebAppsWG
Version: unspecified
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P2
Component: DOM
Assignee: annevk@annevk.nl
Reporter: d@domenic.me
QA Contact: public-webapps-bugzilla@w3.org
CC: mike@w3.org, www-dom@w3.org
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?
--
You are receiving this mail because:
You are on the CC list for the bug.
Received on Wednesday, 29 October 2014 17:29:36 UTC