<?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>117764</bug_id>
          
          <creation_ts>2013-06-18 17:10:28 -0700</creation_ts>
          <short_desc>Serializer doesn&apos;t handling inconsistent prefixes properly</short_desc>
          <delta_ts>2013-08-29 06:49:43 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></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="Alex Milowski">alex</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>rwlbuis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>901590</commentid>
    <comment_count>0</comment_count>
    <who name="Alex Milowski">alex</who>
    <bug_when>2013-06-18 17:10:28 -0700</bug_when>
    <thetext>When constructing an XML document programmatically, the namespaces in use and prefixes may be inconsistent.  For example, the results of merging cloned nodes from different sources may end up with conflicting prefix to namespace mappings.  These conflicts must be detected and the prefixes adjusted.

The current implementation allows multiple namespace attributes for the same prefix which results in an XML parsing error for any receiving application.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>901841</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2013-06-19 10:33:15 -0700</bug_when>
    <thetext>Could you please attach a test case fixing which would be the purpose of this bug? We have quite a few bugs about namespace serialization already, and it&apos;s difficult to track them without explicitly distinct test cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>901863</commentid>
    <comment_count>2</comment_count>
      <attachid>205019</attachid>
    <who name="Alex Milowski">alex</who>
    <bug_when>2013-06-19 11:11:09 -0700</bug_when>
    <thetext>Created attachment 205019
An example of inconsistent handling of namespaces for attributes

Here is the missing attachment that I thought I filed with the original bug.

The test does:

1.  Creates two attributes with different namespaces but the same prefix.

2. Redefined a common prefix (xlink).

The outcome right now is:

1. The &quot;p&quot; prefix is declared twice with to different namespace URIs.

2. A extra xmlns:xlink attribute that maps the the XLink namespace URI is added.

Of course, that won&apos;t parser properly on the way back in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>905204</commentid>
    <comment_count>3</comment_count>
    <who name="Rob Buis">rwlbuis</who>
    <bug_when>2013-07-01 18:49:50 -0700</bug_when>
    <thetext>Bug 19121 has a patch up that fixes this bug too. I incorporated the testcase in it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>922437</commentid>
    <comment_count>4</comment_count>
    <who name="Rob Buis">rwlbuis</who>
    <bug_when>2013-08-29 06:49:43 -0700</bug_when>
    <thetext>Committed r154779: &lt;http://trac.webkit.org/changeset/154779&gt;.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>205019</attachid>
            <date>2013-06-19 11:11:09 -0700</date>
            <delta_ts>2013-06-19 11:11:09 -0700</delta_ts>
            <desc>An example of inconsistent handling of namespaces for attributes</desc>
            <filename>ns-scope-serialization.xhtml</filename>
            <type>application/xhtml+xml</type>
            <size>989</size>
            <attacher name="Alex Milowski">alex</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiPz4KPCFET0NUWVBFIGh0bWw+Cjxo
dG1sIHhtbG5zPSJodH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