<?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>14382</bug_id>
          
          <creation_ts>2007-06-25 04:42:51 -0700</creation_ts>
          <short_desc>Enter key does not trigger onclick when focus on a button</short_desc>
          <delta_ts>2013-04-15 16:13:59 -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>Accessibility</component>
          <version>523.x (Safari 3)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows XP</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WORKSFORME</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>PlatformOnly</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tore B. Krudtaa">krudtaa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
    
    <cc>aroben</cc>
    
    <cc>jcraig</cc>
    
    <cc>pgbakker</cc>
    
    <cc>webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>6368</commentid>
    <comment_count>0</comment_count>
    <who name="Tore B. Krudtaa">krudtaa</who>
    <bug_when>2007-06-25 04:42:51 -0700</bug_when>
    <thetext>Enter key does not trigger onclick when focus on a button

Example code below:
If I hit enter when focus is on the button in IE, Firefox, Opera then the onclick is triggered.... not so with Safari 3.0.2 beta on windows.
As I told in another bug... accesskey does not work on Safari for windows either.

Hope this is to be fixed to.

&lt;button type=&quot;button&quot; onclick=&quot;doSomething()&quot; accesskey=&quot;D&quot; style=&quot;background-color:transparent; border:0px; cursor:pointer;&quot;&gt;
&lt;img src=&quot;sysimg/date.gif&quot; border=&quot;0&quot; title=&quot;Find from date&quot; align=&quot;absmiddle&quot;&gt;
&lt;/button&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3753</commentid>
    <comment_count>1</comment_count>
    <who name="Paul">pgbakker</who>
    <bug_when>2007-07-25 01:32:22 -0700</bug_when>
    <thetext>Noticed this too, really a bad thing from an accessibility point of view....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3564</commentid>
    <comment_count>2</comment_count>
    <who name="Soap Blox">pacified</who>
    <bug_when>2007-07-27 16:54:07 -0700</bug_when>
    <thetext>(In reply to comment #1)
&gt; Noticed this too, really a bad thing from an accessibility point of view....
&gt; 

This is a bug... on windows for sure.  Don&apos;t have a mac, so I can&apos;t debug it myself, but others who do and use my software are complaining.

It&apos;s as if type=&quot;button&quot; on Safari behaves has a type=&quot;submit&quot;, because it does call the onsubmit event when you hit enter on a type=&quot;button&quot;.

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3555</commentid>
    <comment_count>3</comment_count>
    <who name="Soap Blox">pacified</who>
    <bug_when>2007-07-27 17:01:12 -0700</bug_when>
    <thetext>I guess I&apos;m exposing my ignorance here, but even if it were behaving like a type=&quot;button&quot;, shouldn&apos;t the onclick still fire before the onsubmit?

Here&apos;s the code I&apos;m using which isn&apos;t behaving correctly:

&lt;input name=&quot;submitType&quot; value=&quot;Preview&quot; onclick=&quot;preview(this.form)&quot; type=&quot;button&quot;&gt;

I tab to the button, hit enter, and it goes right to the onsubmit event</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3558</commentid>
    <comment_count>4</comment_count>
    <who name="">andgarden</who>
    <bug_when>2007-07-27 17:26:44 -0700</bug_when>
    <thetext>I absolutely see this issue. It appears on Safari Mac, as well. Very annoying for those of us who don&apos;t want to switch contexts to enter a comment.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3559</commentid>
    <comment_count>5</comment_count>
      <attachid>15713</attachid>
    <who name="Soap Blox">pacified</who>
    <bug_when>2007-07-27 18:00:48 -0700</bug_when>
    <thetext>Created attachment 15713
HTML file that illustrates the bug.

Click on the button, you&apos;ll see an alert that says &quot;I am an onclick&quot;.  Tab to the button, hit &quot;return&quot;, you will see an alert that says &quot;I am on onsubmit&quot;.

Using: Safari for Windows, 3.0.2 (522.13.1)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3553</commentid>
    <comment_count>6</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-07-27 21:22:00 -0700</bug_when>
    <thetext>There is no bug on Mac.  This is really a Windows port issue.  

On the Mac, spacebar activates a button, and Enter activates the default button in dialogs.  The two are distinct. This is expected behavior to a Mac user.

On Windows this is not the case (Enter always activates the focused button, and only activates the default button if another button is not focused).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3529</commentid>
    <comment_count>7</comment_count>
    <who name="Soap Blox">pacified</who>
    <bug_when>2007-07-28 11:28:38 -0700</bug_when>
    <thetext>(In reply to comment #6)

Wow, on the PC, if i hit the space bar, I got an onclick.  Strange!  Never knew that.  Now I have to figure out how to set the default button.

hmmm...


</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>3526</commentid>
    <comment_count>8</comment_count>
    <who name="David Kilzer (:ddkilzer)">ddkilzer</who>
    <bug_when>2007-07-28 13:02:24 -0700</bug_when>
    <thetext>(In reply to comment #7)
&gt; Wow, on the PC, if i hit the space bar, I got an onclick.  Strange!  Never knew
&gt; that.  Now I have to figure out how to set the default button.

The default submit button is always the first &lt;input type=&quot;submit&quot;&gt; within the &lt;form&gt;&lt;/form&gt; tags, although this may be browser dependent.  I don&apos;t think there&apos;s a way to set the default button, but I think it may be overridden an onsubmit handler (not sure).

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67062</commentid>
    <comment_count>9</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2008-01-12 14:02:21 -0800</bug_when>
    <thetext>If I&apos;m not mistaken, on TOT both Mac and Windows ports work as this bug report requested. This may mean that we have a bug on Mac now.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>82895</commentid>
    <comment_count>10</comment_count>
    <who name="Robert Blaut">webkit</who>
    <bug_when>2008-06-10 23:36:53 -0700</bug_when>
    <thetext>(In reply to comment #9)
&gt; If I&apos;m not mistaken, on TOT both Mac and Windows ports work as this bug report
&gt; requested. This may mean that we have a bug on Mac now.
&gt; 

The reported bug was fixed so I think we should close the bug report as fixed and eventually file a new report regarding Mac issue but, personally I don&apos;t think that the Mac behavior is buggy. Any other comments on this case?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>876109</commentid>
    <comment_count>11</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-04-15 16:05:05 -0700</bug_when>
    <thetext>Yes, it&apos;s expected that non-default buttons on Mac OS X are activated by pressing spacebar, not Return (or Enter). Given that this bug was for Windows, I&apos;m closing it and cloning for the Mac regression.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>876117</commentid>
    <comment_count>12</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-04-15 16:13:49 -0700</bug_when>
    <thetext>That one is 114648</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>876118</commentid>
    <comment_count>13</comment_count>
    <who name="James Craig">jcraig</who>
    <bug_when>2013-04-15 16:13:59 -0700</bug_when>
    <thetext>bug 114648</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>15713</attachid>
            <date>2007-07-27 18:00:48 -0700</date>
            <delta_ts>2007-07-27 18:00:48 -0700</delta_ts>
            <desc>HTML file that illustrates the bug.</desc>
            <filename>safari_bug.html</filename>
            <type>text/html</type>
            <size>328</size>
            <attacher name="Soap Blox">pacified</attacher>
            
              <data encoding="base64">PGh0bWw+DQo8aGVhZD4NCjxzY3JpcHQ+DQoNCmZ1bmN0aW9uIGRvT25DbGljayh0aGVGb3JtKSB7
DQoJYWxlcnQoIkkgYW0gYW4gb25jbGljayEiKTsNCn0NCg0KZnVuY3Rpb24gZG9PblN1Ym1pdCgp
IHsNCglhbGVydCgiSSBhbSBhbiBvbnN1Ym1pdCEiKTsNCn0NCg0KPC9zY3JpcHQ+DQo8L2hlYWQ+
DQo8Ym9keT4NCjxmb3JtIG9uc3VibWl0PSJkb09uU3VibWl0KCk7IHJldHVybiBmYWxzZTsiPg0K
DQo8aW5wdXQgdmFsdWU9ImJ1dHRvbiIgdHlwZT0iYnV0dG9uIiBvbmNsaWNrPSJkb09uQ2xpY2so
dGhpcy5mb3JtKSIgLz4NCg0KPC9mb3JtPg0KPC9ib2R5Pg0KPC9odG1sPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>