<?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>70934</bug_id>
          
          <creation_ts>2011-10-26 08:46:07 -0700</creation_ts>
          <short_desc>Moving an SVG element (in the DOM) during a mousedown prevents the following click event</short_desc>
          <delta_ts>2022-08-12 14:29:34 -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>UI Events</component>
          <version>528+ (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="Xavier Morel">webkit.org</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>490874</commentid>
    <comment_count>0</comment_count>
      <attachid>112515</attachid>
    <who name="Xavier Morel">webkit.org</who>
    <bug_when>2011-10-26 08:46:07 -0700</bug_when>
    <thetext>Created attachment 112515
Test case

This may happen for any element, I did not test it, but it happened on SVG elements for me.

Problem test case:
* Click on the partially hidden blue ellipsis on top
* Expected: print a message
✔ Observed: print a message

* Click on the partially hidden blue ellipsis in the middle group
* Expected: print a message
✔ Observed: print a message

* Click on the partially hidden blue ellipsis in the bottom group
* Expected: the blue ellipsis moves on top of the red one
* Expected: print a message
✔ Observed: the blue ellipsis moves on top of the red one
✘ Observed: *no message is printed*

All ellipsis have the exact same click handler, which prints a message (with their class name) below the SVG frame.

In the third case, the ellipsis is moved around in the DOM in order to be stacked on top of the red ellipsis (you can click on the partially hidden red ellipsis of the third group after that to do it again): as far as I know, SVG draws elements in strict document order, so the only way to have an element on top of an other is to put them in the correct order in the DOM.

Since the click event is the same on all `ellipse` elements, one would expect to see the same behavior everywhere. And indeed if you click twice on the blue ellipsis (once to put it on top of the red one and once more) you will see the message print correctly.

Context:
* Creating graphs using the Dracula library http://www.graphdracula.net/
* Dracula defers to Raphaël for the SVG backend: http://raphaeljs.com/
* Dracula handles drag&amp;dropping nodes (by default, not sure it can be disabled) which can be seen on the front-page example, this is handled via mouse* events
* In the latest Dracula version (this does not seem to happen in the one on the front page), the `mousedown` event starting the drag makes a call to Raphael&apos;s Element#toFront: https://github.com/strathausen/dracula/blob/master/js/dracula_graph.js#L166
* Element#toFront moves the element to ensure it is the last one in its parent: https://github.com/DmitryBaranovskiy/raphael/blob/master/raphael.svg.js#L1049

As a result, when trying to hook a `click` event to a node (which Raphael supports: http://raphaeljs.com/reference.html#Element.click)… it did not work at all in Webkit browsers (and was quite annoying to track down).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890988</commentid>
    <comment_count>1</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-12 14:16:37 -0700</bug_when>
    <thetext>I am able to reproduce the issue in attached test case for bottom group in Safari 15.6 and Safari Technical Preview 151 on macOS 12.5, where clicking on &quot;blue&quot; move it on top of &quot;red&quot; ellipsis but it does not show any message. It is same case with Chrome Canary 106 but it is different with Firefox Nightly 105, which shows this message: &quot;Clicked movetotop&quot;.

I am changing the status to &quot;New&quot; now. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890993</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-08-12 14:29:34 -0700</bug_when>
    <thetext>&lt;rdar://problem/98586986&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>112515</attachid>
            <date>2011-10-26 08:46:07 -0700</date>
            <delta_ts>2011-10-26 08:46:07 -0700</delta_ts>
            <desc>Test case</desc>
            <filename>movebug.html</filename>
            <type>text/html</type>
            <size>1962</size>
            <attacher name="Xavier Morel">webkit.org</attacher>
            
              <data encoding="base64">PCFkb2N0eXBlIGh0bWw+CjxodG1sPgogIDxoZWFkPgogICAgPG1ldGEgY2hhcnNldD0idXRmLTgi
PgoKICAgIDx0aXRsZT5TVkcgRE9NIG1vdmUgZXZlbnQgZGlzcGFyaXRpb248L3RpdGxlPgogICAg
PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgogICAgICBkb2N1bWVudC5hZGRFdmVudExp
c3RlbmVyKCJET01Db250ZW50TG9hZGVkIiwgZnVuY3Rpb24gKCkgewogICAgICAgICAgJ3VzZSBz
dHJpY3QnOwogICAgICAgICAgdmFyIGVscyA9IGRvY3VtZW50LmdldEVsZW1lbnRzQnlUYWdOYW1l
KCdlbGxpcHNlJyk7CiAgICAgICAgICBmb3IgKHZhciBpPTA7IGk8ZWxzLmxlbmd0aDsgKytpKSB7
CiAgICAgICAgICAgICAgZWxzW2ldLmFkZEV2ZW50TGlzdGVuZXIoJ2NsaWNrJywgZnVuY3Rpb24g
KCkgewogICAgICAgICAgICAgICAgICBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgnbG9nJykuYXBw
ZW5kQ2hpbGQoCiAgICAgICAgICAgICAgICAgICAgICBkb2N1bWVudC5jcmVhdGVUZXh0Tm9kZSgn
Q2xpY2tlZCAnICsgdGhpcy5nZXRBdHRyaWJ1dGUoJ2NsYXNzJykgKyAnXG4nKSk7CiAgICAgICAg
ICAgICAgfSk7Ci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