<?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>25704</bug_id>
          
          <creation_ts>2014-05-14 08:04:45 +0000</creation_ts>
          <short_desc>&quot;When an element&apos;s id attribute is removed, unse...&quot;</short_desc>
          <delta_ts>2014-05-14 13:11:19 +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>DOM</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Pieters">zcorpan</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>crimsteam</cc>
    
    <cc>mike</cc>
    
    <cc>www-dom</cc>
          
          <qa_contact>public-webapps-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>105944</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-14 08:04:45 +0000</bug_when>
    <thetext>http://dom.spec.whatwg.org/#interface-element

[[
When an element&apos;s id attribute is removed, unset the element&apos;s ID.
]]

...or when it is set to the empty string?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105948</commentid>
    <comment_count>1</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-05-14 09:55:28 +0000</bug_when>
    <thetext>Set to empty string not removed id attribute.

&lt;script type = &quot;text/javascript&quot;&gt;

 var el = document.createElement(&quot;div&quot;);

　alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // false

 el.id = &quot;test&quot;;

 alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // true

 el.id = &quot;&quot;;

 alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // true

&lt;/script&gt;

But this looks strange:
&quot;Either when an element is created that has an id attribute whose value is not the empty string or when an element&apos;s id attribute is set to a value other than the empty string, set the element&apos;s ID to the new value.&quot;

&lt;script type = &quot;text/javascript&quot;&gt;

 var el = document.createElement(&quot;div&quot;);

　alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // false

 el.id = &quot;&quot;;
 el.setAttribute(&quot;id&quot;, &quot;&quot;);

 alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // true

&lt;/script&gt;

Or maybe create/remove has some other meaning?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105949</commentid>
    <comment_count>2</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-05-14 10:10:31 +0000</bug_when>
    <thetext>And another case:

&lt;p id=&quot;&quot;&gt;&lt;/p&gt;

&lt;script type = &quot;text/javascript&quot;&gt;

 alert(document.getElementById(&quot;&quot;)); // null

 var el = document.getElementsByTagName(&quot;p&quot;)[0];

　alert(el.getAttribute(&quot;id&quot;));
 alert(el.id);
 alert(el.hasAttribute(&quot;id&quot;)); // true

&lt;/script&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105950</commentid>
    <comment_count>3</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-05-14 11:17:36 +0000</bug_when>
    <thetext>https://github.com/whatwg/dom/commit/967552c81e1912a6ace72050a3a68a257c1ff672</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105966</commentid>
    <comment_count>4</comment_count>
    <who name="Simon Pieters">zcorpan</who>
    <bug_when>2014-05-14 13:08:55 +0000</bug_when>
    <thetext>spiritRKS1910 it seems you confuse the attribute with the &quot;ID&quot; concept. &lt;p id=&quot;&quot;&gt; has an &quot;id&quot; attribute but does not have an ID.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105967</commentid>
    <comment_count>5</comment_count>
    <who name="Arkadiusz Michalski (Spirit)">crimsteam</who>
    <bug_when>2014-05-14 13:11:19 +0000</bug_when>
    <thetext>Yup, I realize about it after submit this examples, but thx for answer, good catch.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>