<?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>17283</bug_id>
          
          <creation_ts>2012-06-01 11:34:51 +0000</creation_ts>
          <short_desc>Consider making `null` for reflecting IDL attributes remove the content attribute</short_desc>
          <delta_ts>2013-03-09 01:14:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc>http://www.whatwg.org/specs/web-apps/current-work/#reflecting-content-attributes-in-idl-attributes</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P3</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>robin</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>68498</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-06-01 11:34:51 +0000</bug_when>
    <thetext>Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/common-dom-interfaces.html
Multipage: http://www.whatwg.org/C#reflecting-content-attributes-in-idl-attributes
Complete: http://www.whatwg.org/c#reflecting-content-attributes-in-idl-attributes

Comment:
Consider making `null` for reflecting IDL attributes remove the content
attribute

Posted from: 2001:4c28:a030:30:3cae:bc42:712:f92c by simonp@opera.com
User agent: Opera/9.80 (Macintosh; Intel Mac OS X 10.7.3; U; en) Presto/2.10.229 Version/11.64</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68501</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 11:47:17 +0000</bug_when>
    <thetext>Opera willfully violates the spec when it comes to setting null to IDL attributes because we found several sites that broke, e.g. by setting &lt;input&gt;.max = null which caused the form to be unsubmittable.

We stringify null to &quot;&quot; for *all* DOMString IDL attributes. However, it occurred to us that the site compat problems were only related to IDL attributes that reflect content attributes. Gecko seems to stringify to &quot;&quot; for that case. WebKit seems to remove the content attribute. Either is probably Web-compatible.

I think removing the content attribute is nicer than setting it to the empty string. Consider the crossorigin attribute. The empty string is a valid keyword, so doing crossOrigin = null, if it stringifies to &quot;&quot;, sets the attribute to the Anonymous state. There would be no way of setting it to the No CORS state, short of using removeAttribute(&apos;crossorigin&apos;) which is more verbose.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68502</commentid>
    <comment_count>2</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 11:49:33 +0000</bug_when>
    <thetext>A place where it makes more sense to stringify null to &quot;null&quot; is localStorage.foo = null; since reading it back can be JSON.parse()d.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>68503</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2012-06-01 11:57:42 +0000</bug_when>
    <thetext>It would be &quot;nice&quot; to make getting the IDL attribute return null if the attribute is absent, but nobody does that so likely isn&apos;t compatible.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69790</commentid>
    <comment_count>4</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-10 16:18:13 +0000</bug_when>
    <thetext>Is there an IDL attribute I can use to make &quot;null&quot; stringify to empty on setting for a DOMString IDL attribute, or does it have to be prose?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69791</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-07-10 16:26:42 +0000</bug_when>
    <thetext>(is there a corresponding bug on WebIDL about changing the behaviour for all attributes?)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>69793</commentid>
    <comment_count>6</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-07-10 16:56:56 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; Is there an IDL attribute I can use to make &quot;null&quot; stringify to empty on
&gt; setting for a DOMString IDL attribute, or does it have to be prose?

[TreatNullAs=EmptyString]; however, I think that what Simon proposes makes more sense. I filed &lt;https://bugzilla.mozilla.org/show_bug.cgi?id=772526&gt;.

(Another question is what to do with non-DOMString reflecting attributes; I&apos;m not sure if we&apos;d want to make the same change there in the same time frame, because that&apos;s somewhat hard with our current bindings.)

(In reply to comment #5)
&gt; (is there a corresponding bug on WebIDL about changing the behaviour for all
&gt; attributes?)

We agreed not to do that; I think we can and should stay with that decision.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71046</commentid>
    <comment_count>7</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:58:45 +0000</bug_when>
    <thetext>This bug was cloned to create bug 18290 as part of operation convergence.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72719</commentid>
    <comment_count>8</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-24 19:08:33 +0000</bug_when>
    <thetext>Realistically speaking, this is a massive potentially breaking change. See jst&apos;s comment in:
   https://bugzilla.mozilla.org/show_bug.cgi?id=772526#c2

I&apos;m fine with doing this, but not before a browser has forged the way.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72865</commentid>
    <comment_count>9</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-27 22:30:06 +0000</bug_when>
    <thetext>Marking NEEDSINFO. The info I need is that a browser has done this and it wasn&apos;t catastrophic.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>72866</commentid>
    <comment_count>10</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-08-27 22:30:42 +0000</bug_when>
    <thetext>(moving to LATER so it doesn&apos;t drop off my radar)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>84158</commentid>
    <comment_count>11</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2013-03-09 01:14:51 +0000</bug_when>
    <thetext>Given the lack of interest and the lack of browser vendors doing this, I&apos;m punting this to WONTFIX. If any browser is interested in leading on this, and wants the spec changed accordingly based on their experience, please let me know and/or reopen the bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>