<?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>10239</bug_id>
          
          <creation_ts>2006-08-03 13:08:37 -0700</creation_ts>
          <short_desc>XMLSerializer drops attribute values when attribute are previously accessed with getAttributeNode</short_desc>
          <delta_ts>2019-02-06 09:02:40 -0800</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>417.x</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc>http://www.veerwest.com/test/safari_test_case.html</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Cedric Savarese">cedric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>51628</commentid>
    <comment_count>0</comment_count>
    <who name="Cedric Savarese">cedric</who>
    <bug_when>2006-08-03 13:08:37 -0700</bug_when>
    <thetext>See the test case provided.

Here is the javascript code that reproduces the problem.
&lt;script type=&quot;text/javascript&quot;&gt;

	var domDoc = (new DOMParser()).parseFromString(&quot;&lt;test&gt;&lt;element attr1=\&quot;test\&quot; attr2=\&quot;\&quot; attr3=\&quot;something\&quot; /&gt;&lt;/test&gt;&quot;, &quot;text/xml&quot;);

	var xmlSerializer = new XMLSerializer();

	var serializedXML = xmlSerializer.serializeToString(domDoc);

	document.write(&quot;&lt;textarea cols=&apos;60&apos; rows=&apos;5&apos;&gt;&quot; + serializedXML + &quot;&lt;/textarea&gt;&quot;);

	var element = domDoc.getElementsByTagName(&apos;element&apos;)[0];

	attr = element.getAttributeNode(&apos;attr1&apos;);

	var serializedXML = xmlSerializer.serializeToString(domDoc);

	document.write(&quot;&lt;textarea cols=&apos;60&apos; rows=&apos;5&apos;&gt;&quot; + serializedXML + &quot;&lt;/textarea&gt;&quot;);

    document.write(&quot;&lt;br/&gt;Node value: &quot;+ element.getAttributeNode(&apos;attr1&apos;).nodeValue);

&lt;/script&gt; 

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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>51756</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-08-04 06:07:23 -0700</bug_when>
    <thetext>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 &lt;http://nightly.webkit.org&gt;.

Not sure what exactly fixed this, so closing as WORKSFORME.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1502818</commentid>
    <comment_count>2</comment_count>
    <who name="Lucas Forschler">lforschler</who>
    <bug_when>2019-02-06 09:02:40 -0800</bug_when>
    <thetext>Mass moving XML DOM bugs to the &quot;DOM&quot; Component.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>