<?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>19122</bug_id>
          
          <creation_ts>2008-05-18 22:19:06 -0700</creation_ts>
          <short_desc>XMLHttpRequest should use a more reasonable method to serialize documents</short_desc>
          <delta_ts>2008-05-19 10:17:26 -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>XML</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>18421</dup_id>
          
          <bug_file_loc>http://lists.w3.org/Archives/Public/public-webapi/2008May/0294.html</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="Alexey Proskuryakov">ap</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>80879</commentid>
    <comment_count>0</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-05-18 22:19:06 -0700</bug_when>
    <thetext>From the bug URL:

---------------------------
   var doc = document.implementation.createDocument(&quot;&quot;, &quot;&quot;, null);
   var el = doc.createElementNS(&quot;ns1&quot;, &quot;x:y&quot;);
   el.setAttributeNS(&quot;ns2&quot;, &quot;x:z&quot;, &quot;val&quot;);
   doc.appendChild(el);
   var xhr = new XMLHttpRequest();
   xhr.open(&quot;POST&quot;, &quot;echo.cgi&quot;, false);
   xhr.send(doc);
   alert(xhr.responseText);

Here echo.cgi is the following CGI:

   #!/usr/bin/perl 

   print &quot;Content-Type: text/plain\n\n&quot;;
   while (&lt;&gt;) {
     print;
   }

Here are the results I see:

   Firefox 3rc1:

     &lt;x:y xmlns:x=&quot;ns1&quot; a0:z=&quot;val&quot; xmlns:a0=&quot;ns2&quot;/&gt;

   Opera 9.25:

     &lt;?xml version=&quot;1.0&quot;?&gt;&lt;x:y x:z=&quot;val&quot; xmlns:x=&quot;ns1&quot;/&gt;

   Safari 3.1:

     &lt;x:y x:z=&quot;val&quot; /&gt;

Ignoring the Safari serialization, which is not in fact ns-wellformed no matter 
how you slice it, the other two are ns-wellformed XML.  Neither one roundtrips 
to quite the original document.  Which one is &quot;correct&quot; per the current spec? 
Or is it neither one?  Should an exception have been thrown in this case?  Why 
or why not?  If there shouldn&apos;t have been an exception in this case, how is a UA 
to determine that?
---------------------------

JSXMLHttpRequest uses Document::toString(), which is a weird method, see also: bug 18421.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>80899</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-05-19 10:17:26 -0700</bug_when>
    <thetext>Will attach a fix to bug 18421.

*** This bug has been marked as a duplicate of 18421 ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>