<?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>7783</bug_id>
          
          <creation_ts>2006-03-15 07:52:52 -0800</creation_ts>
          <short_desc>onclick handler set from popup doesn&apos;t work</short_desc>
          <delta_ts>2008-02-22 17:22:59 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>417.x</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>HasReduction</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Brian Sweet">brian.sweet</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ian</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>36441</commentid>
    <comment_count>0</comment_count>
    <who name="Brian Sweet">brian.sweet</who>
    <bug_when>2006-03-15 07:52:52 -0800</bug_when>
    <thetext>The attached sample file has two links &quot;CLICK ME&quot; and &quot;OPEN POPUP&quot;.  When you first click &quot;CLICK ME&quot; an alert dialog will open and print &quot;A&quot;.  Then if you click &quot;OPEN POPUP&quot;, a popup will open and inside the popup it calls a method back on the parent page which changes the onclick handler of the &quot;CLICK ME&quot; link.  The popup then closes itself.

In Safari, the &quot;CLICK ME&quot; link will no longer work.  In all of Firefox, IE and Opera the &quot;CLICK ME&quot; link will now open an alert dialog and print &quot;B&quot;.

My guess is that Safari is incorrectly cleaning up the onclick handler which was assigned by the popup javascript code when the popup closes, even though the call was made from the window.parent (main window) object and referenced a function that is defined on the main window.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>36442</commentid>
    <comment_count>1</comment_count>
      <attachid>7087</attachid>
    <who name="Brian Sweet">brian.sweet</who>
    <bug_when>2006-03-15 07:54:23 -0800</bug_when>
    <thetext>Created attachment 7087
Example showing onclick set from popup failure in Safari</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>54107</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2006-08-28 22:12:34 -0700</bug_when>
    <thetext>See also: bug 3791.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>71537</commentid>
    <comment_count>3</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2008-02-22 17:22:59 -0800</bug_when>
    <thetext>Test case works for me with a local debug build of WebKit r30458.

</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>7087</attachid>
            <date>2006-03-15 07:54:23 -0800</date>
            <delta_ts>2006-03-15 07:54:23 -0800</delta_ts>
            <desc>Example showing onclick set from popup failure in Safari</desc>
            <filename>popup_test.html</filename>
            <type>text/html</type>
            <size>998</size>
            <attacher name="Brian Sweet">brian.sweet</attacher>
            
              <data encoding="base64">PGh0bWw+PGhlYWQ+PHRpdGxlPlBvcHVwIHRlc3QgcGFnZTwvdGl0bGU+Cgo8U0NSSVBUIGxhbmd1
YWdlPSJKYXZhU2NyaXB0Ij4KCnZhciBTQ1JJUFRfTk9ERSA9ICJzY3JpcHQiOwoKZnVuY3Rpb24g
dGVzdF9hKCkKewogICAgYWxlcnQoICJBIiApOwp9CgpmdW5jdGlvbiB0ZXN0X2IoKQp7CiAgICBh
bGVydCggIkIiICk7Cn0KCmZ1bmN0aW9uIFVwZGF0ZV9saW5rKCkKewogICAgZG9jdW1lbnQuZ2V0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