<?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>16409</bug_id>
          
          <creation_ts>2012-03-16 20:54:00 +0000</creation_ts>
          <short_desc>DOM4: Consider LeafNode interface which Node inherits from</short_desc>
          <delta_ts>2012-05-15 10:53:55 +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>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alex Vincent">ajvincent</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>bzbarsky</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>65676</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Vincent">ajvincent</who>
    <bug_when>2012-03-16 20:54:00 +0000</bug_when>
    <thetext>Andreas Gal&apos;s domjs project ( https://github.com/andreasgal/dom.js ) has an interesting idea:  a separate class for &quot;leaf nodes&quot;, which cannot have children.

I wonder if this might be worth adding to the DOM4 spec, by splitting the Node interface into two parts:  
(1) A LeafNode interface which implements all the current Node&apos;s interface properties except firstChild, childNodes, lastChild, insertBefore, appendChild, replaceChild, and removeChild.
(2) A Node interface which inherits from LeafNode and adds those extracted properties.

interface LeafNode : EventTarget;
interface Node : LeafNode;

It might make text nodes, comments, etc. - nodes that can&apos;t have children - somewhat simpler.

I&apos;m only asking for consideration of the idea.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65678</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2012-03-16 21:18:54 +0000</bug_when>
    <thetext>Wouldn&apos;t this break existing scripts that iterate over the DOM?  How do you expect UAs to implement it?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65749</commentid>
    <comment_count>2</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-03-19 16:04:23 +0000</bug_when>
    <thetext>We have followed this approach for new mutation methods. Not sure if we can do it for the legacy ones.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>65750</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-03-19 16:05:06 +0000</bug_when>
    <thetext>If you want to do this I suggest experimenting in a browser whether you can move some methods down from Node and then remove them from selected interfaces.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67722</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-05-15 10:53:55 +0000</bug_when>
    <thetext>Resolving as WONTFIX because changing the classes around is a huge compatibility risk. If a browser (like with the Attr redesign) is willing to test this out we&apos;ll look at this more concretely.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>