<?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>199426</bug_id>
          
          <creation_ts>2019-07-02 17:57:37 -0700</creation_ts>
          <short_desc>Assertion fires when setting the event of an SVG element which is referenced by a &lt;use&gt; element</short_desc>
          <delta_ts>2019-07-02 17:59:50 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <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="Said Abou-Hallawa">sabouhallawa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1549793</commentid>
    <comment_count>0</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-07-02 17:57:37 -0700</bug_when>
    <thetext>Open the following test case in WebKit.

    &lt;svg&gt;
        &lt;tspan id=&quot;text&quot;/&gt;
        &lt;use xlink:href=&quot;#text&quot;/&gt;
    &lt;/svg&gt;
    &lt;script&gt;
        setTimeout( function() {
            var text = document.getElementById(&quot;text&quot;);
            text.setAttribute(&quot;onfocusout&quot;, &quot;onfocusout&quot;);
        }, 0);
    &lt;/script&gt;

Result: The following assertion fires:

#0	0x000000011300b5e0 in ::WTFCrash()
#1	0x0000000118bd32db in WTFCrashWithInfo(int, char const*, char const*, int)
#2	0x000000011ac58b0c in WebCore::JSLazyEventListener::checkValidityForEventTarget(WebCore::EventTarget&amp;)
#3	0x000000011b28a1b9 in WebCore::EventTarget::addEventListener(WTF::AtomString const&amp;, WTF::Ref&lt;WebCore::EventListener, WTF::DumbPtrTraits&lt;WebCore::EventListener&gt; &gt;&amp;&amp;, WebCore::EventTarget::AddEventListenerOptions const&amp;)
#4	0x000000011b2fcea0 in WebCore::tryAddEventListener(WebCore::Node*, WTF::AtomString const&amp;, WTF::Ref&lt;WebCore::EventListener, WTF::DumbPtrTraits&lt;WebCore::EventListener&gt; &gt;&amp;&amp;, WebCore::EventTarget::AddEventListenerOptions const&amp;)
#5	0x000000011b2fce38 in WebCore::Node::addEventListener(WTF::AtomString const&amp;, WTF::Ref&lt;WebCore::EventListener, WTF::DumbPtrTraits&lt;WebCore::EventListener&gt; &gt;&amp;&amp;, WebCore::EventTarget::AddEventListenerOptions const&amp;)
#6	0x000000011c9717a0 in WebCore::SVGElement::addEventListener(WTF::AtomString const&amp;, WTF::Ref&lt;WebCore::EventListener, WTF::DumbPtrTraits&lt;WebCore::EventListener&gt; &gt;&amp;&amp;, WebCore::EventTarget::AddEventListenerOptions const&amp;)
#7	0x000000011b28ae2b in WebCore::EventTarget::setAttributeEventListener(WTF::AtomString const&amp;, WTF::RefPtr&lt;WebCore::EventListener, WTF::DumbPtrTraits&lt;WebCore::EventListener&gt; &gt;&amp;&amp;, WebCore::DOMWrapperWorld&amp;)
#8	0x000000011b240e86 in WebCore::Element::setAttributeEventListener(WTF::AtomString const&amp;, WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#9	0x000000011c9713c5 in WebCore::SVGElement::parseAttribute(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#10	0x000000011cac7e40 in WebCore::SVGGraphicsElement::parseAttribute(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#11	0x000000011cbe8d37 in WebCore::SVGTextContentElement::parseAttribute(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#12	0x000000011cbe5ad5 in WebCore::SVGTextPositioningElement::parseAttribute(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#13	0x000000011b23baa8 in WebCore::Element::attributeChanged(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;, WTF::AtomString const&amp;, WebCore::Element::AttributeModificationReason)
#14	0x000000011b39778f in WebCore::StyledElement::attributeChanged(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;, WTF::AtomString const&amp;, WebCore::Element::AttributeModificationReason)
#15	0x000000011c9720fb in WebCore::SVGElement::attributeChanged(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;, WTF::AtomString const&amp;, WebCore::Element::AttributeModificationReason)
#16	0x000000011b2429df in WebCore::Element::didAddAttribute(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;)
#17	0x000000011b242923 in WebCore::Element::addAttributeInternal(WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;, WebCore::Element::SynchronizationOfLazyAttribute)
#18	0x000000011b23b241 in WebCore::Element::setAttributeInternal(unsigned int, WebCore::QualifiedName const&amp;, WTF::AtomString const&amp;, WebCore::Element::SynchronizationOfLazyAttribute)
#19	0x000000011b23b4fd in WebCore::Element::setAttribute(WTF::AtomString const&amp;, WTF::AtomString const&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1549794</commentid>
    <comment_count>1</comment_count>
      <attachid>373374</attachid>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-07-02 17:58:24 -0700</bug_when>
    <thetext>Created attachment 373374
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1549795</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2019-07-02 17:59:50 -0700</bug_when>
    <thetext>&lt;rdar://problem/52424891&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>373374</attachid>
            <date>2019-07-02 17:58:24 -0700</date>
            <delta_ts>2019-07-02 17:58:24 -0700</delta_ts>
            <desc>test case</desc>
            <filename>test-case.html</filename>
            <type>text/html</type>
            <size>232</size>
            <attacher name="Said Abou-Hallawa">sabouhallawa</attacher>
            
              <data encoding="base64">PHN2Zz4KICAgIDx0c3BhbiBpZD0idGV4dCIvPgogICAgPHVzZSB4bGluazpocmVmPSIjdGV4dCIv
Pgo8L3N2Zz4KPHNjcmlwdD4KICAgIHNldFRpbWVvdXQoIGZ1bmN0aW9uKCkgewogICAgICAgIHZh
ciB0ZXh0ID0gZG9jdW1lbnQuZ2V0RWxlbWVudEJ5SWQoInRleHQiKTsKICAgICAgICB0ZXh0LnNl
dEF0dHJpYnV0ZSgib25mb2N1c291dCIsICJvbmZvY3Vzb3V0Iik7CiAgICB9LCAwKTsKPC9zY3Jp
cHQ+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>