<?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>24271</bug_id>
          
          <creation_ts>2014-01-11 02:17:19 +0000</creation_ts>
          <short_desc>Document.createElement name validation inconsistent with HTML parse rules</short_desc>
          <delta_ts>2014-02-12 19:41:30 +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>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>LATER</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="Pete Blois">w3c</reporter>
          <assigned_to name="Anne">annevk</assigned_to>
          <cc>d</cc>
    
    <cc>hsivonen</cc>
    
    <cc>mike</cc>
    
    <cc>Ms2ger</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>98274</commentid>
    <comment_count>0</comment_count>
    <who name="Pete Blois">w3c</who>
    <bug_when>2014-01-11 02:17:19 +0000</bug_when>
    <thetext>Document.createElement name validation rules (https://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#dom-document-createelement) uses different validation from the HTML parser (http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tag-name-state). This means that elements can be created via the parser which cannot be created via createElement.

The parser rules are much more permissive. For what it&apos;s worth, I do not believe that any two browsers support the same exact set of unicode characters for document.createElement.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98275</commentid>
    <comment_count>1</comment_count>
    <who name="Domenic Denicola">d</who>
    <bug_when>2014-01-11 02:32:20 +0000</bug_when>
    <thetext>I too have found this troubling, but I was told there may be some compat risks with relaxing this restriction when I last asked about it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98276</commentid>
    <comment_count>2</comment_count>
    <who name="Ms2ger">Ms2ger</who>
    <bug_when>2014-01-11 07:52:11 +0000</bug_when>
    <thetext>(In reply to Pete Blois from comment #0)
&gt; I do not believe that any two browsers support the same exact
&gt; set of unicode characters for document.createElement.

Can you give examples of inputs that are handled differently?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98294</commentid>
    <comment_count>3</comment_count>
    <who name="Pete Blois">w3c</who>
    <bug_when>2014-01-12 00:11:33 +0000</bug_when>
    <thetext>Examples:
document.createElement(&apos;\u0083&apos;); (FF 26- no, Chrome 31- no, IE 11- yes)
document.createElement(&apos;\u00b5&apos;); (FF 26- yes, Chrome 31- no, IE 11- yes)
document.createElement(&apos;\u01f6&apos;); (FF 26- no, Chrome 32- yes, IE 11- yes)
document.createElement(&apos;\u01f7&apos;); (FF 26- no, Chrome 32- yes, IE 11- no)

The XML spec changed the validation from XML 1.0 Fourth Edition to XML 1.0 Fifth Edition- fourth edition was based on unicode character sets (http://www.w3.org/TR/2006/REC-xml-20060816/#NT-Letter)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98320</commentid>
    <comment_count>4</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-13 11:41:33 +0000</bug_when>
    <thetext>I&apos;m not going to make 4th vs 5th edition my problem.

However, only the last two of your examples are testing the difference between those as far as I can tell. The first two should throw for either edition.

So only Chrome makes some sense (though following the 5th edition is questionable).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98321</commentid>
    <comment_count>5</comment_count>
    <who name="Henri Sivonen">hsivonen</who>
    <bug_when>2014-01-13 11:53:27 +0000</bug_when>
    <thetext>I&apos;m opposed to making any XML 1.0 5th edition-motivated code changes in Gecko. I think we should stick to 4th ed. until XML5/XML-ER arrives some day.

If it doesn&apos;t break the Web, I&apos;d be OK with permitting whatever the HTML parser can create.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>98323</commentid>
    <comment_count>6</comment_count>
    <who name="Anne">annevk</who>
    <bug_when>2014-01-13 14:10:57 +0000</bug_when>
    <thetext>As far as I can tell Chrome is compliant per 5th. Firefox wants to follow 4th but actually does not do that (it allows U+00B5 in XML). Not sure about IE11. However, none of that makes it clear whether we can allow the kind of names HTML allows, such as &quot;x,&quot;.

I recommend that if people want to take this further they get browsers to experiment with what is possible. I&apos;d be happy to throw less exceptions here. I&apos;m also happy to break the tie with XML if it&apos;s demonstrated that is possible.

If you file bugs on browsers to do those experiments please cross-link with this bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>