<?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>20407</bug_id>
          
          <creation_ts>2012-12-16 03:52:10 +0000</creation_ts>
          <short_desc>allow attributes to have different types for their getter and setter</short_desc>
          <delta_ts>2012-12-30 23:23:51 +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>NEW</bug_status>
          <resolution></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="Cameron McCormack">cam</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>annevk</cc>
    
    <cc>bruant.d</cc>
    
    <cc>bugs</cc>
    
    <cc>ian</cc>
    
    <cc>jackalmage</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
    
    <cc>robin</cc>
    
    <cc>waldron.rick</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80248</commentid>
    <comment_count>0</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-12-16 03:52:10 +0000</bug_when>
    <thetext>http://lists.whatwg.org/pipermail/whatwg-whatwg.org/2012-December/038362.html

Maybe syntax like:

  attribute FileList? set (FileList? or sequence&lt;Blob&gt;) files;

would work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80249</commentid>
    <comment_count>1</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-12-16 13:37:15 +0000</bug_when>
    <thetext>Feels ugly to me. Reminds me of PutForwards.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80256</commentid>
    <comment_count>2</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2012-12-17 10:26:07 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Feels ugly to me. Reminds me of PutForwards.

Is it the syntax or the feature that you find ugly? If it&apos;s the syntax, we can certainly bikeshed it, e.g.:

    attribute FileList?/(FileList? or sequence&lt;Blob&gt;) files;

and many other variants. But I don&apos;t think that we can dodge the fact that the feature itself represents a genuine need.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80257</commentid>
    <comment_count>3</comment_count>
    <who name="David Bruant">bruant.d</who>
    <bug_when>2012-12-17 10:32:34 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; Feels ugly to me. 

I think one not ugly way would be to have one super-type and all types used in the getter/setter use this super-type.
But retrofitting a super-type after things are already deployed on the web doesn&apos;t feel like realistic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80258</commentid>
    <comment_count>4</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-12-17 10:55:48 +0000</bug_when>
    <thetext>(In reply to comment #2)
&gt; Is it the syntax or the feature that you find ugly?
The feature. You set property to [ objectOfTypeA ], yet you
get back [ objectOfTypeB ].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80259</commentid>
    <comment_count>5</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2012-12-17 12:24:37 +0000</bug_when>
    <thetext>We already do type conversion, I don&apos;t really see how this is different.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80271</commentid>
    <comment_count>6</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-12-17 14:59:10 +0000</bug_when>
    <thetext>This would not be conversion, but creating new objects from the 
data passed to setter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80292</commentid>
    <comment_count>7</comment_count>
    <who name="Tab Atkins Jr.">jackalmage</who>
    <bug_when>2012-12-17 17:32:13 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt; This would not be conversion, but creating new objects from the 
&gt; data passed to setter.

I believe Anne means that a setFoo/getFoo pair, where setFoo accepts a wider variety of things but getFoo returns a specific type, is already possible, acceptable, and widely used.  Thus, why is it unacceptable to do the same with an attribute?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80708</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-12-30 05:00:45 +0000</bug_when>
    <thetext>It&apos;s even done with attributes, e.g. anywhere we use PutForwards. This just seem like a variant on that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80716</commentid>
    <comment_count>9</comment_count>
    <who name="Olli Pettay">bugs</who>
    <bug_when>2012-12-30 14:02:35 +0000</bug_when>
    <thetext>Exactly. As I said in comment 1, reminds me of PutForwards. And some people
think (I&apos;m certainly not the only one) that use of PutForwards is bad API design.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80740</commentid>
    <comment_count>10</comment_count>
    <who name="Cameron McCormack">cam</who>
    <bug_when>2012-12-30 23:23:51 +0000</bug_when>
    <thetext>If [PutForwards] is bad, I would say it is due to it being not obvious what the actual property being changed is, not because it has asymmetric get/set types.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>