<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>25893</bug_id>
          
          <creation_ts>2009-05-20 10:46:51 -0700</creation_ts>
          <short_desc>createElement should support passing markup instead of just element name, e.g. document.createElement(&quot;&lt;select readonly&gt;&quot;)</short_desc>
          <delta_ts>2022-08-05 10:06:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</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="Lúcio Flávio Corrêa">lucio.correa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>enqd</cc>
    
    <cc>evan</cc>
    
    <cc>ian</cc>
    
    <cc>lucio.correa</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>rniwa</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>122190</commentid>
    <comment_count>0</comment_count>
    <who name="Lúcio Flávio Corrêa">lucio.correa</who>
    <bug_when>2009-05-20 10:46:51 -0700</bug_when>
    <thetext>Hey Guys. I&apos;m trying to access a website (www.minhacasaminhavida.pe.gov.br) but webkit based browsers doesn&apos;t work with that. This is the message returned by WebInpector:

INVALID_CHARACTER_ERR: DOM Exception 5
HTMLComponents.js:1962Error: INVALID_CHARACTER_ERR: DOM Exception 5

The file location is http://www.minhacasaminhavida.pe.gov.br/pmc/components/HTMLComponents.js

Thanks in Advance</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122208</commentid>
    <comment_count>1</comment_count>
    <who name="Lúcio Flávio Corrêa">lucio.correa</who>
    <bug_when>2009-05-20 15:27:12 -0700</bug_when>
    <thetext>(In reply to comment #0)
&gt; Hey Guys. I&apos;m trying to access a website (www.minhacasaminhavida.pe.gov.br) but
&gt; webkit based browsers doesn&apos;t work with that. This is the message returned by
&gt; WebInpector:
&gt; 
&gt; INVALID_CHARACTER_ERR: DOM Exception 5
&gt; HTMLComponents.js:1962Error: INVALID_CHARACTER_ERR: DOM Exception 5
&gt; 
&gt; The file location is
&gt; http://www.minhacasaminhavida.pe.gov.br/pmc/components/HTMLComponents.js
&gt; 
&gt; Thanks in Advance
&gt; 

Ah, forgot to add that it works in Firefox and IE too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122331</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-05-21 05:50:54 -0700</bug_when>
    <thetext>Believe it or not, but Firefox successfully creates a SELECT element with document.createElement(&quot;&lt;select&gt;&quot;). IE has a separate code path.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122332</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2009-05-21 05:53:04 -0700</bug_when>
    <thetext>Seems we should file a bug with mozilla.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>122333</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-05-21 06:00:01 -0700</bug_when>
    <thetext>IE even supports document.createElement(&quot;&lt;select readonly&gt;&quot;), but Firefox does not.

My guess is that Firefox had to partially implement this IE quirk for web compatibility.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271494</commentid>
    <comment_count>5</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-08-30 10:25:46 -0700</bug_when>
    <thetext>*** Bug 44841 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>271496</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2010-08-30 10:27:37 -0700</bug_when>
    <thetext>Another example of a broken site in duplicate bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>329255</commentid>
    <comment_count>7</comment_count>
    <who name="Evan Martin">evan</who>
    <bug_when>2011-01-04 15:29:31 -0800</bug_when>
    <thetext>Alexey&apos;s guess in comment 4 is correct:

Mozilla bug discussing the problem:
https://bugzilla.mozilla.org/show_bug.cgi?id=489532

Diff showing they added angle brackets:
http://bonsai.mozilla.org/cvsblame.cgi?file=mozilla/content/html/document/src/nsHTMLDocument.cpp&amp;rev=3.791&amp;mark=1459,1467-1473#1458

But it looks like they removed it in 2004:
http://hg.mozilla.org/mozilla-central/rev/ecdf587c02d0</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>329272</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2011-01-04 16:03:24 -0800</bug_when>
    <thetext>&gt; But it looks like they removed it in 2004:
&gt; http://hg.mozilla.org/mozilla-central/rev/ecdf587c02d0

In fact, that&apos;s July 2010, just weird date formatting.

If Mozilla won&apos;t reconsider removing this quirk before shipping Firefox 4, we almost certainly don&apos;t want to add it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>329492</commentid>
    <comment_count>9</comment_count>
    <who name="Ms2ger (he/him; ⌚ UTC+1/+2)">Ms2ger</who>
    <bug_when>2011-01-05 02:02:07 -0800</bug_when>
    <thetext>I don&apos;t think Mozilla will add this quirk back. (At least, I&apos;ll do what I can to avoid it.)

Lúcio, any chance you could contact the website? The changes they need to make come down to changing document.createElement(&quot;&lt;img&gt;&quot;) to document.createElement(&quot;img&quot;). (The ones that are guarded by isIE checks are probably not problematic.)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1889145</commentid>
    <comment_count>10</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-05 10:06:07 -0700</bug_when>
    <thetext>The test case from Mozilla Bug mentioned in Comment 07 behaves same across all browsers:

Link - http://software.hixie.ch/utilities/js/live-dom-viewer/?%3Cscript%3Ew%28document.createElement%28%22%3Cx%3E%22%29%29%3C%2Fscript%3E

** Safari 15.6 on macOS 12.5 **

error: InvalidCharacterError: The string contains invalid characters. on line 1
rendering mode: BackCompat
document has no title

** Firefox Nightly 105 **

error: InvalidCharacterError: String contains an invalid character on line 1

rendering mode: BackCompat

document has no title

** Chrome Canary 106 **

error: Uncaught InvalidCharacterError: Failed to execute &apos;createElement&apos; on &apos;Document&apos;: The tag name provided (&apos;&lt;x&gt;&apos;) is not a valid name. on line 1
rendering mode: BackCompat
document has no title

____

Since all browsers are now matching with each other, I am going to mark this as &quot;RESOLVED CONFIGURATION CHANGED&quot;. Please reopen, if I have mark it as wrong. Thanks!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>