<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>27191</bug_id>
          
          <creation_ts>2014-10-29 17:29:35 +0000</creation_ts>
          <short_desc>&quot;callback interface NodeFilter&quot;</short_desc>
          <delta_ts>2014-10-29 17:44:34 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebAppsWG</product>
          <component>DOM</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Domenic Denicola">d</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>cam</cc>
    
    <cc>d</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>114212</commentid>
    <comment_count>0</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-10-29 17:29:35 +0000</bug_when>
    <thetext>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,

&gt; Callback interfaces are ones that can be implemented by user objects and not by platform objects, as described in section 3.9 below. 

Also

&gt; Static attributes and static operations MUST NOT be defined on a callback interface. 

Which doesn&apos;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&apos;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?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114213</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-29 17:36:48 +0000</bug_when>
    <thetext>&gt; Which doesn&apos;t specifically call out `const`s, but seems the same in spirit.

It doesn&apos;t call them out because they&apos;re allowed on callback interfaces.

&gt; I think (but am not sure) per WebIDL callback interfaces don&apos;t exist globally.

http://heycam.github.io/webidl/#es-interfaces is pretty clear on this: they exist if they have constants.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114214</commentid>
    <comment_count>2</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-10-29 17:42:56 +0000</bug_when>
    <thetext>Ah OK. Thanks for catching me!

(It would be really nice if the ES mapping was not so separated from the definition -_-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114215</commentid>
    <comment_count>3</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2014-10-29 17:44:34 +0000</bug_when>
    <thetext>Yeah, this split between &quot;es bindings&quot; and &quot;language-independent stuff&quot; is annoying.  :(</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>