WebKit Bugzilla
New
Browse
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WORKSFORME
10239
XMLSerializer drops attribute values when attribute are previously accessed with getAttributeNode
https://bugs.webkit.org/show_bug.cgi?id=10239
Summary
XMLSerializer drops attribute values when attribute are previously accessed w...
Cedric Savarese
Reported
2006-08-03 13:08:37 PDT
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.
Attachments
Add attachment
proposed patch, testcase, etc.
Alexey Proskuryakov
Comment 1
2006-08-04 06:07:23 PDT
I can reproduce this issue with stock 10.4.7 Safari, but not with a recent nightly (
r15780
). You can get a nightly build to verify the behavior from <
http://nightly.webkit.org
>. Not sure what exactly fixed this, so closing as WORKSFORME.
Lucas Forschler
Comment 2
2019-02-06 09:02:40 PST
Mass moving XML DOM bugs to the "DOM" Component.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug