<?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>29151</bug_id>
          
          <creation_ts>2015-09-25 19:48:13 +0000</creation_ts>
          <short_desc>Clarify if assigning wrong enumeration value to an attribute should throw</short_desc>
          <delta_ts>2016-10-21 21:05:44 +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>WORKSFORME</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="Chris Dumez">chris</reporter>
          <assigned_to name="Cameron McCormack">cam</assigned_to>
          <cc>bzbarsky</cc>
    
    <cc>d</cc>
    
    <cc>mike</cc>
    
    <cc>public-script-coord</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>123313</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Dumez">chris</who>
    <bug_when>2015-09-25 19:48:13 +0000</bug_when>
    <thetext>I may have missed something but I initially read the ECMAScript bindings section for enumerations [1] and it said to throw a TypeError if the input value is not a valid value for this enumeration.

However, I then noticed a Note in the non-ECMAScript enumeration section [2] that says we should only throw when converting operation arguments but NOT when assigning an attribute. If this is really the intended behavior for ECMAScript bindings, I think it would be worse specifying it in [1] instead of simply in a Note.

[1] https://heycam.github.io/webidl/#es-enumeration
[2] https://heycam.github.io/webidl/#idl-enums</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123314</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Dumez">chris</who>
    <bug_when>2015-09-25 19:50:58 +0000</bug_when>
    <thetext>I work on WebKit and looking at our ECMAScript bindings, it seems that we behave as indicated in the Note:
&quot;&quot;&quot;
Note
In the ECMAScript binding, assignment of an invalid string value to an attribute is ignored, while passing such a value as an operation argument results in an exception being thrown.
&quot;&quot;&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123315</commentid>
    <comment_count>2</comment_count>
    <who name="Boris Zbarsky">bzbarsky</who>
    <bug_when>2015-09-25 20:03:24 +0000</bug_when>
    <thetext>This behavior is specified in https://heycam.github.io/webidl/#dfn-attribute-setter step 4 which doesn&apos;t invoke https://heycam.github.io/webidl/#es-enumeration at all but instead uses a slightly different algorithm.  So https://heycam.github.io/webidl/#es-enumeration is only invoked for operation arguments, dictionary members, sequence members, and so forth.

I agree that it&apos;s a bit confusing to do it that way, but it avoids the problem of saying in https://heycam.github.io/webidl/#es-enumeration that the behavior depends on &quot;where it&apos;s called from&quot;, which is a bit hard to define precisely.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>123316</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Dumez">chris</who>
    <bug_when>2015-09-25 21:05:17 +0000</bug_when>
    <thetext>(In reply to Boris Zbarsky from comment #2)
&gt; This behavior is specified in
&gt; https://heycam.github.io/webidl/#dfn-attribute-setter step 4 which doesn&apos;t
&gt; invoke https://heycam.github.io/webidl/#es-enumeration at all but instead
&gt; uses a slightly different algorithm.  So
&gt; https://heycam.github.io/webidl/#es-enumeration is only invoked for
&gt; operation arguments, dictionary members, sequence members, and so forth.
&gt; 
&gt; I agree that it&apos;s a bit confusing to do it that way, but it avoids the
&gt; problem of saying in https://heycam.github.io/webidl/#es-enumeration that
&gt; the behavior depends on &quot;where it&apos;s called from&quot;, which is a bit hard to
&gt; define precisely.

Ok, thank you. I assumed there was something I missed in the spec what I wanted to confirm. I think it is fine to leave as is then.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>