<?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>21270</bug_id>
          
          <creation_ts>2013-03-13 17:05:12 +0000</creation_ts>
          <short_desc>Introduce syntax for getters that keep returning the same object</short_desc>
          <delta_ts>2013-08-02 06:08:40 +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>WebIDL</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          <blocked>21271</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Anne">annevk</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>jsbell</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>travil</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>84352</commentid>
    <comment_count>0</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2013-03-13 17:05:12 +0000</bug_when>
    <thetext>It would be nice if we could annotate e.g. Node.childNodes and Element.attributes in IDL with something that indicates the same object will be returned each time.

Gecko has [Constant] for this. We could maybe have something like NodeList* to indicate it returns a pointer rather than a new object (in C terms...).

Alternative we could maybe say that this is the default and use &quot;new NodeList&quot; for the other case, but then there are some getters that will sometimes return the same object and sometimes a new one. Or maybe say that unless the prose uses the word new, it must be taken as the same object will be returned each time...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84354</commentid>
    <comment_count>1</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2013-03-13 17:10:40 +0000</bug_when>
    <thetext>I bet the prose for .firstChild never mentions &quot;new&quot;.  ;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84357</commentid>
    <comment_count>2</comment_count>
    <who name="Travis Leithead [MSFT]">travil</who>
    <bug_when>2013-03-13 17:25:28 +0000</bug_when>
    <thetext>I like the idea of a concise syntax that describes this (without needing to use a verbose extended attribute); however, I don&apos;t like the asterisk (*) since it&apos;s an overloaded concept with C.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84909</commentid>
    <comment_count>3</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-03-25 05:44:00 +0000</bug_when>
    <thetext>I think this is would be a reasonable addition, although I think it should be opt in rather than the default.  What about:

  interface Node {
    const attribute NodeList childNodes;
  };

That reads nicely to me, with the small downside of complicating the LL(1) grammar.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>91536</commentid>
    <comment_count>4</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2013-08-02 06:08:40 +0000</bug_when>
    <thetext>Resolved here: http://lists.w3.org/Archives/Public/public-script-coord/2013JulSep/0133.html</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>