<?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>99893</bug_id>
          
          <creation_ts>2012-10-19 17:25:38 -0700</creation_ts>
          <short_desc>When there are two elements with the same ID, xlink:href should refer to the first.</short_desc>
          <delta_ts>2023-07-27 10:19:11 -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>SVG</component>
          <version>420+</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          <see_also>https://bugs.webkit.org/show_bug.cgi?id=139155</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philip Rogers">pdr</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>fmalita</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>746799</commentid>
    <comment_count>0</comment_count>
      <attachid>169732</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2012-10-19 17:25:38 -0700</bug_when>
    <thetext>Created attachment 169732
Testcase

When there are two elements with the same ID, xlink:href should refer to the first, even if they are added to the document out of order.

Our current resource tracking implementation in SVGDocumentExtensions.cpp does not handle the case when a duplicate ID is added after (in document time) but before (in document order). See the attached testcase for an example.

&lt;tref xlink:href=&quot;abcd&quot;/&gt;

&lt;text id=&quot;abcd&quot;&gt; &lt;/text&gt; &lt;-- tref should point to the first text, even if it is dynamically added after the other duplicated id.
&lt;text id=&quot;abcd&quot;&gt; &lt;/text&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>780728</commentid>
    <comment_count>1</comment_count>
    <who name="Florin Malita">fmalita</who>
    <bug_when>2012-12-01 07:14:37 -0800</bug_when>
    <thetext>(In reply to comment #0)
&gt; When there are two elements with the same ID, xlink:href should refer to the first

Is this behavior required by some spec? I can&apos;t easily find it, and I would have thought this is undefined.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1481068</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2018-11-22 21:34:56 -0800</bug_when>
    <thetext>This bug still exists.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1882968</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-13 03:40:31 -0700</bug_when>
    <thetext>I am reproduce this bug in Safari 15.5 on macOS 12.4 using attached test case. It shows &quot;FAIL&quot; in green text while all other browsers (Chrome Canary 105 and Firefox Nightly 104) does not show anything at all (not even PASS). Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884315</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-07-15 15:39:52 -0700</bug_when>
    <thetext>&lt;rdar://problem/97098045&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968470</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2023-07-27 10:19:11 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/16145</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>169732</attachid>
            <date>2012-10-19 17:25:38 -0700</date>
            <delta_ts>2012-10-19 17:25:38 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>tref.html</filename>
            <type>text/html</type>
            <size>1214</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KPCEtLSBUZXN0IHRoYXQgd2hlbiB0d28gZWxl
bWVudHMgd2l0aCB0aGUgc2FtZSBpZCBhcmUgaW4gdGhlIGRvY3VtZW50LAogICAgIGVsZW1lbnRz
IHRoYXQgcmVmZXJlbmNlIHRoZSBkdXBsaWNhdGVkIGlkIGVuZCB1cCByZWZlcnJpbmcgdG8gdGhl
CiAgICAgZmlyc3Qgb2YgdGhlIHR3by4gLS0+CjwhLS0gSWYgdGhpcyB0ZXN0IHBhc3NlcywgeW91
IHNob3VsZCBzZWUgdGhlIHdvcmQgIlBBU1MiLiAtLT4KPHNjcmlwdD4KICBmdW5jdGlvbiBkb1Rl
c3QoKSB7CiAgICB2YXIgZGVmczIgPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnZGVmczInKTsK
ICAgIHZhciByZWZlcmVuY2VkVGV4dDIgPSBkb2N1bWVudC5jcmVhdGVFbGVtZW50TlMoImh0dHA6
Ly93d3cudzMub3JnLzIwMDAvc3ZnIiwgInRleHQiKTsKICAgIHJlZmVyZW5jZWRUZXh0Mi5zZXRB
dHRyaWJ1dGUoImlkIiwgIlJlZmVyZW5jZWRUZXh0Iik7CiAgICByZWZlcmVuY2VkVGV4dDIudGV4
dENvbnRlbnQgPSAiRkFJTCI7CiAgICBkZWZzMi5hcHBlbmRDaGlsZChyZWZlcmVuY2VkVGV4dDIp
OwoKICAgIHZhciBkZWZzMSA9IGRvY3VtZW50LmdldEVsZW1lbnRCeUlkKCdkZWZzMScpOwogICAg
dmFyIHJlZmVyZW5j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