<?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>16175</bug_id>
          
          <creation_ts>2007-11-28 12:01:34 -0800</creation_ts>
          <short_desc>javascript:self.close();&quot; close window javascript doesn&apos;t work when window is a tab</short_desc>
          <delta_ts>2009-10-14 07:30:15 -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>New Bugs</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</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>0</everconfirmed>
          <reporter name="Theodore Lee">theodorewlee</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>tvignaud</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>62590</commentid>
    <comment_count>0</comment_count>
    <who name="Theodore Lee">theodorewlee</who>
    <bug_when>2007-11-28 12:01:34 -0800</bug_when>
    <thetext>Using the following javascript/html code:

&lt;form&gt;&lt;input type=&quot;button&quot; value=&quot;Close Window&quot; onClick=&quot;javascript:self.close();&quot;&gt;&lt;/center&gt;&lt;/form&gt;

Safari will close a window, but only when that Window is not a tabbed window. When you have this code in a window that is a tab, pressing the button does nothing.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62662</commentid>
    <comment_count>1</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-11-28 23:23:18 -0800</bug_when>
    <thetext>JavaScript can only close windows it opened, and since it can&apos;t open a tab without user interaction, it can&apos;t close tabs either.

It would be interesting to have support for an &quot;_tab&quot; target, though, that would open a new tab (as &quot;_blank&quot; opens a new window).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>62695</commentid>
    <comment_count>2</comment_count>
    <who name="Theodore Lee">theodorewlee</who>
    <bug_when>2007-11-29 06:31:02 -0800</bug_when>
    <thetext>The behavior in Firefox is that this Javascript will close a page (whether it is a free standing Window or a tab) without any issues. IE7 will close the page as well (again, whether a free standing Window or tab), but offers up a confirmation dialog before it will close.

In each of these circumstances, the page/tab with the containing code is not a page that was opened by Javascript, but rather, by clicking through a link or landing on a page after submitting a form. 

I agree that it would be nice to have a &quot;_tab&quot; target, to bring Safari inline with other browsers behavior (and make it more compatible with today&apos;s web apps), the behavior should be changed to mirror Firefox/IE in that this javascript will close the Window, regardless of whether it is a free standing Window or a tab.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63105</commentid>
    <comment_count>3</comment_count>
      <attachid>17671</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-12-03 02:15:52 -0800</bug_when>
    <thetext>Created attachment 17671
test case

Same test, as an attachment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>63106</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2007-12-03 02:18:49 -0800</bug_when>
    <thetext>I cannot reproduce this issue with Safari 3.0.4 or TOT on Tiger or Leopard. I&apos;ve been opening two tabs with the test case, and clicking the Close button - it worked fine.

I suspect a conflict with a Safari extension - do you have any installed? </thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103701</commentid>
    <comment_count>5</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-12-29 04:21:13 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I cannot reproduce this issue with Safari 3.0.4 or TOT on Tiger or Leopard.
&gt; I&apos;ve been opening two tabs with the test case, and clicking the Close button -
&gt; it worked fine.
&gt; 
&gt; I suspect a conflict with a Safari extension - do you have any installed? 
&gt; 

I also cannot reproduce the reported problem in WebKit r39474.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>154571</commentid>
    <comment_count>6</comment_count>
    <who name="Thierry Vignaud">tvignaud</who>
    <bug_when>2009-10-14 07:30:15 -0700</bug_when>
    <thetext>Still valid as of webkit-1.1.15.1 as used by epiphany-2.28.0 or midori-0.1.10.

Duplicate of bug #13474 IMHO</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>17671</attachid>
            <date>2007-12-03 02:15:52 -0800</date>
            <delta_ts>2007-12-03 02:15:52 -0800</delta_ts>
            <desc>test case</desc>
            <filename>16175.html</filename>
            <type>text/html</type>
            <size>100</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PGZvcm0+PGlucHV0IHR5cGU9ImJ1dHRvbiIgdmFsdWU9IkNsb3NlIFdpbmRvdyIKb25DbGljaz0i
amF2YXNjcmlwdDpzZWxmLmNsb3NlKCk7Ij48L2NlbnRlcj48L2Zvcm0+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>