Bug 19122

Summary: XMLHttpRequest should use a more reasonable method to serialize documents
Product: WebKit Reporter: Alexey Proskuryakov <ap>
Component: XMLAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal    
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: All   
OS: All   
URL: http://lists.w3.org/Archives/Public/public-webapi/2008May/0294.html

Alexey Proskuryakov
Reported 2008-05-18 22:19:06 PDT
From the bug URL: --------------------------- var doc = document.implementation.createDocument("", "", null); var el = doc.createElementNS("ns1", "x:y"); el.setAttributeNS("ns2", "x:z", "val"); doc.appendChild(el); var xhr = new XMLHttpRequest(); xhr.open("POST", "echo.cgi", false); xhr.send(doc); alert(xhr.responseText); Here echo.cgi is the following CGI: #!/usr/bin/perl print "Content-Type: text/plain\n\n"; while (<>) { print; } Here are the results I see: Firefox 3rc1: <x:y xmlns:x="ns1" a0:z="val" xmlns:a0="ns2"/> Opera 9.25: <?xml version="1.0"?><x:y x:z="val" xmlns:x="ns1"/> Safari 3.1: <x:y x:z="val" /> 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 "correct" 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'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.
Attachments
Alexey Proskuryakov
Comment 1 2008-05-19 10:17:26 PDT
Will attach a fix to bug 18421. *** This bug has been marked as a duplicate of 18421 ***
Note You need to log in before you can comment on or make changes to this bug.