[Webkit-unassigned] [Bug 10239] New: XMLSerializer drops attribute values when attribute are previously accessed with getAttributeNode
bugzilla-daemon at opendarwin.org
bugzilla-daemon at opendarwin.org
Thu Aug 3 13:08:37 PDT 2006
http://bugzilla.opendarwin.org/show_bug.cgi?id=10239
Summary: XMLSerializer drops attribute values when attribute are
previously accessed with getAttributeNode
Product: WebKit
Version: 417.x
Platform: Macintosh
URL: http://www.veerwest.com/test/safari_test_case.html
OS/Version: Mac OS X 10.4
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: XML DOM
AssignedTo: webkit-unassigned at opendarwin.org
ReportedBy: cedric at veerwest.com
See the test case provided.
Here is the javascript code that reproduces the problem.
<script type="text/javascript">
var domDoc = (new DOMParser()).parseFromString("<test><element
attr1=\"test\" attr2=\"\" attr3=\"something\" /></test>", "text/xml");
var xmlSerializer = new XMLSerializer();
var serializedXML = xmlSerializer.serializeToString(domDoc);
document.write("<textarea cols='60' rows='5'>" + serializedXML +
"</textarea>");
var element = domDoc.getElementsByTagName('element')[0];
attr = element.getAttributeNode('attr1');
var serializedXML = xmlSerializer.serializeToString(domDoc);
document.write("<textarea cols='60' rows='5'>" + serializedXML +
"</textarea>");
document.write("<br/>Node value: "+
element.getAttributeNode('attr1').nodeValue);
</script>
The second textarea shows that the value for the attr1 attribute is lost in the
serialization. The DOM is still correct because the value can still be
accessed.
If the call to getAttributeNode is removed, the second serialization works
fine.
--
Configure bugmail: http://bugzilla.opendarwin.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list