<?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>18290</bug_id>
          
          <creation_ts>2012-07-18 17:58:42 +0000</creation_ts>
          <short_desc>Consider making `null` for reflecting IDL attributes remove the content attribute</short_desc>
          <delta_ts>2013-02-07 18:58:51 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML WG</product>
          <component>HTML5 spec</component>
          <version>unspecified</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>NEEDSINFO</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>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>contributor</reporter>
          <assigned_to name="Edward O&apos;Connor">eoconnor</assigned_to>
          <cc>eoconnor</cc>
    
    <cc>ian</cc>
    
    <cc>mike</cc>
    
    <cc>plh</cc>
    
    <cc>public-html-admin</cc>
    
    <cc>public-html-wg-issue-tracking</cc>
    
    <cc>zcorpan</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>71045</commentid>
    <comment_count>0</comment_count>
    <who name="">contributor</who>
    <bug_when>2012-07-18 17:58:42 +0000</bug_when>
    <thetext>This was was cloned from bug 17283 as part of operation convergence.
Originally filed: 2012-06-01 11:34:00 +0000

================================================================================
 #0   contributor@whatwg.org                          2012-06-01 11:34:51 +0000 
--------------------------------------------------------------------------------
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
================================================================================
 #1   Simon Pieters                                   2012-06-01 11:47:17 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #2   Simon Pieters                                   2012-06-01 11:49:33 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #3   Simon Pieters                                   2012-06-01 11:57:42 +0000 
--------------------------------------------------------------------------------
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.
================================================================================
 #4   Ian &apos;Hixie&apos; Hickson                             2012-07-10 16:18:13 +0000 
--------------------------------------------------------------------------------
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?
================================================================================
 #5   Ian &apos;Hixie&apos; Hickson                             2012-07-10 16:26:42 +0000 
--------------------------------------------------------------------------------
(is there a corresponding bug on WebIDL about changing the behaviour for all attributes?)
================================================================================
 #6   Ms2ger                                          2012-07-10 16:56:56 +0000 
--------------------------------------------------------------------------------
(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>72224</commentid>
    <comment_count>1</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2012-08-15 17:13:25 +0000</bug_when>
    <thetext>Filter on [Idon&apos;tcareaboutHTMLWGbugspam].</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>73342</commentid>
    <comment_count>2</comment_count>
    <who name="Edward O&apos;Connor">eoconnor</who>
    <bug_when>2012-09-06 17:50:51 +0000</bug_when>
    <thetext>As Ian points out in https://www.w3.org/Bugs/Public/show_bug.cgi?id=17283#c8 such a change has the potential to be massively backwards incompatible. We shouldn&apos;t make such a change in the HTML5 timeframe. Assigning this to HTML.next so we can re-evaluate in the future.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81656</commentid>
    <comment_count>3</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-01-21 15:57:53 +0000</bug_when>
    <thetext>Mass move to &quot;HTML WG&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>81767</commentid>
    <comment_count>4</comment_count>
    <who name="Robin Berjon">robin</who>
    <bug_when>2013-01-21 16:00:34 +0000</bug_when>
    <thetext>Mass move to &quot;HTML WG&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82706</commentid>
    <comment_count>5</comment_count>
    <who name="Edward O&apos;Connor">eoconnor</who>
    <bug_when>2013-02-07 18:58:51 +0000</bug_when>
    <thetext>EDITOR&apos;S RESPONSE: This is an Editor&apos;s Response to your comment. If you are
satisfied with this response, please change the state of this bug to CLOSED. If
you have additional information and would like the Editor to reconsider, please
reopen this bug. If you would like to escalate the issue to the full HTML
Working Group, please add the TrackerRequest keyword to this bug, and suggest
title and text for the Tracker Issue; or you may create a Tracker Issue
yourself, if you are able to do so. For more details, see this document:

   http://dev.w3.org/html5/decision-policy/decision-policy.html

Status: Additional Information Needed
Change Description: No spec change.
Rationale: We shouldn&apos;t make this spec change before we hear from a
browser engine which has made the change and found the resulting level
of breakage acceptable. Let&apos;s revisit this when we&apos;ve heard from such
an implementation.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>