<?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>29920</bug_id>
          
          <creation_ts>2009-09-30 05:56:19 -0700</creation_ts>
          <short_desc>Make a copy of listeners array before dispatching an event</short_desc>
          <delta_ts>2009-10-01 06:17:16 -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>Web Inspector (Deprecated)</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</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="Yury Semikhatsky">yurys</reporter>
          <assigned_to name="Yury Semikhatsky">yurys</assigned_to>
          <cc>commit-queue</cc>
    
    <cc>pmuellr</cc>
    
    <cc>timothy</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>151232</commentid>
    <comment_count>0</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-09-30 05:56:19 -0700</bug_when>
    <thetext>Make a copy of listeners array before dispatching an event in WebInspector.Object.prototype.dispatchEventToListeners. Otherwise if current listener removes itself from the array next listener will be skipped.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151234</commentid>
    <comment_count>1</comment_count>
      <attachid>40366</attachid>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-09-30 06:05:24 -0700</bug_when>
    <thetext>Created attachment 40366
patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151267</commentid>
    <comment_count>2</comment_count>
      <attachid>40366</attachid>
    <who name="Timothy Hatcher">timothy</who>
    <bug_when>2009-09-30 09:18:45 -0700</bug_when>
    <thetext>Comment on attachment 40366
patch

Why did you remove the bind calls?

Those are needed to pass the event as the this object.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151310</commentid>
    <comment_count>3</comment_count>
    <who name="Patrick Mueller">pmuellr</who>
    <bug_when>2009-09-30 11:43:23 -0700</bug_when>
    <thetext>Looks like the bind() should be on preventDefault, but not on stopPropagation.  Not harmful on stopPropagation, but it&apos;s not needed, and otherwise creates a new function closure for no good reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151469</commentid>
    <comment_count>4</comment_count>
    <who name="Yury Semikhatsky">yurys</who>
    <bug_when>2009-09-30 23:48:07 -0700</bug_when>
    <thetext>(In reply to comment #2)
&gt; (From update of attachment 40366 [details])
&gt; Why did you remove the bind calls?
&gt; 
&gt; Those are needed to pass the event as the this object.

There is no need to bind the functions to event since &apos;this&apos; variable will be resolved dynamically and as long as preventDefault and stopPropagation are invoked on &apos;event&apos; &apos;this&apos; object will be === &apos;event&apos;. Please tell me if you still want me to revert the changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151522</commentid>
    <comment_count>5</comment_count>
      <attachid>40366</attachid>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-01 06:17:12 -0700</bug_when>
    <thetext>Comment on attachment 40366
patch

Clearing flags on attachment: 40366

Committed r48970: &lt;http://trac.webkit.org/changeset/48970&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>151523</commentid>
    <comment_count>6</comment_count>
    <who name="WebKit Commit Bot">commit-queue</who>
    <bug_when>2009-10-01 06:17:16 -0700</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>40366</attachid>
            <date>2009-09-30 06:05:24 -0700</date>
            <delta_ts>2009-10-01 06:17:12 -0700</delta_ts>
            <desc>patch</desc>
            <filename>copy-listeners.patch</filename>
            <type>text/plain</type>
            <size>1642</size>
            <attacher name="Yury Semikhatsky">yurys</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1dlYkNvcmUvQ2hhbmdlTG9nIGIvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXgg
YWFjYzNkYy4uODZlYTlmNiAxMDA2NDQKLS0tIGEvV2ViQ29yZS9DaGFuZ2VMb2cKKysrIGIvV2Vi
Q29yZS9DaGFuZ2VMb2cKQEAgLTEsMyArMSwxNiBAQAorMjAwOS0wOS0zMCAgWXVyeSBTZW1pa2hh
dHNreSAgPHl1cnlzQGNocm9taXVtLm9yZz4KKworICAgICAgICBSZXZpZXdlZCBieSBUaW1vdGh5
IEhhdGNoZXIuCisKKyAgICAgICAgTWFrZSBhIGNvcHkgb2YgbGlzdGVuZXJzIGFycmF5IGJlZm9y
ZSBkaXNwYXRjaGluZyBhbiBldmVudCBpbgorICAgICAgICBXZWJJbnNwZWN0b3IuT2JqZWN0LnBy
b3RvdHlwZS5kaXNwYXRjaEV2ZW50VG9MaXN0ZW5lcnMuIE90aGVyd2lzZSBpZiBjdXJyZW50Cisg
ICAgICAgIGxpc3RlbmVyIHJlbW92ZXMgaXRzZWxmIGZyb20gdGhlIGFycmF5IG5leHQgbGlzdGVu
ZXIgd2lsbCBiZSBza2lwcGVkLgorCisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3No
b3dfYnVnLmNnaT9pZD0yOTkyMAorCisgICAgICAgICogaW5zcGVjdG9yL2Zyb250LWVuZC9PYmpl
Y3QuanM6CisgICAgICAgIChXZWJJbnNwZWN0b3IuT2JqZWN0LnByb3RvdHlwZS5kaXNwYXRjaEV2
ZW50VG9MaXN0ZW5lcnMpOiBtYWtlIGEgY29weSBvZiBsaXN0ZW5lcnMgYX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WNlKDApOwogICAg
ICAgICBmb3IgKHZhciBpID0gMDsgaSA8IGxpc3RlbmVycy5sZW5ndGg7ICsraSkgewogICAgICAg
ICAgICAgbGlzdGVuZXJzW2ldLmxpc3RlbmVyLmNhbGwobGlzdGVuZXJzW2ldLnRoaXNPYmplY3Qs
IGV2ZW50KTsKICAgICAgICAgICAgIGlmIChzdG9wcGVkUHJvcGFnYXRpb24pCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>