<?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>24304</bug_id>
          
          <creation_ts>2009-03-02 16:01:46 -0800</creation_ts>
          <short_desc>REGRESSION (r39864): Hitting the space bar to select an &lt;input type=radio&gt; or push an &lt;input type=button&gt; causes the page to scroll down.</short_desc>
          <delta_ts>2009-03-17 12:44:46 -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>Forms</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>PC</rep_platform>
          <op_sys>OS X 10.5</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar, Regression</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Marc-André Decoste">mad</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>ap</cc>
    
    <cc>darin</cc>
    
    <cc>igitur</cc>
    
    <cc>mad</cc>
    
    <cc>mario.bensi</cc>
    
    <cc>tal.ayal.cohen</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>111921</commentid>
    <comment_count>0</comment_count>
    <who name="Marc-André Decoste">mad</who>
    <bug_when>2009-03-02 16:01:46 -0800</bug_when>
    <thetext>This bug was introduced by http://trac.webkit.org/changeset/39864.

The following form helps expose the problem which occurs when you set the focus to the radio button and hit the space bar on your keyboard. The page scrolls... and it shouldn&apos;t... right?

&lt;form action=&quot;http://www.example.com/&quot; method=&quot;post&quot;&gt;
&lt;input type=&quot;text&quot; name=&quot;one&quot; /&gt;
&lt;input type=&quot;radio&quot; name=&quot;two&quot; /&gt;
&lt;div style=&quot;height:5000px;&quot;&gt; &lt;/div&gt;
&lt;input type=&quot;submit&quot; /&gt;
&lt;/form&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111933</commentid>
    <comment_count>1</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-02 16:49:59 -0800</bug_when>
    <thetext>I tested this on Mac and could not reproduce the problem. Space bar worked fine and did not cause any scrolling. Maybe it&apos;s only for non-Mac platforms.

The reason this should not happen is that the code in the radio button implementation should call setDefaultHandled(true) and that should cause the scrolling code to not do anything.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111942</commentid>
    <comment_count>2</comment_count>
    <who name="Marc-André Decoste">mad</who>
    <bug_when>2009-03-02 17:43:22 -0800</bug_when>
    <thetext>That was my guess (the radio button to call setDefaultHandled(true)), but I couldn&apos;t find where that code should be... I&apos;m willing to fix it if I can find where it is :-)...
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111945</commentid>
    <comment_count>3</comment_count>
    <who name="Marc-André Decoste">mad</who>
    <bug_when>2009-03-02 17:54:19 -0800</bug_when>
    <thetext>Actually, I thought it could be there, but a comment says it shouldn&apos;t... for some reason...

WebKit\WebCore\html\HTMLInputElement.cpp
HTMLInputElement::defaultEventHandler()
[...]
  case RADIO:
    setActive(true, true);
    // No setDefaultHandled() - IE dispatches a keypress in this case.
    return;

This code was added as part of:
http://trac.webkit.org/changeset/28620

</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>111975</commentid>
    <comment_count>4</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-03 00:10:07 -0800</bug_when>
    <thetext>If we were to call setDefaultHandled(true) in keydown event handler, then keypress wouldn&apos;t be dispatched, not matching IE.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112045</commentid>
    <comment_count>5</comment_count>
    <who name="Francois Botha">igitur</who>
    <bug_when>2009-03-03 10:57:55 -0800</bug_when>
    <thetext>Similar thing happens with I use the space bar to press a button.  Does this warrant a separate issue to be filed?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>112051</commentid>
    <comment_count>6</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-03 11:22:24 -0800</bug_when>
    <thetext>I think it would be fine to have one bug that covers both.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113352</commentid>
    <comment_count>7</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2009-03-12 02:41:07 -0700</bug_when>
    <thetext>&lt;rdar://problem/6674180&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113961</commentid>
    <comment_count>8</comment_count>
      <attachid>28672</attachid>
    <who name="Adele Peterson">adele</who>
    <bug_when>2009-03-16 17:46:00 -0700</bug_when>
    <thetext>Created attachment 28672
initial version of patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113962</commentid>
    <comment_count>9</comment_count>
    <who name="Adele Peterson">adele</who>
    <bug_when>2009-03-16 17:46:59 -0700</bug_when>
    <thetext>Darin came up with an initial patch (see attached).  We were calling the base class early in too many cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>113963</commentid>
    <comment_count>10</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-16 17:47:50 -0700</bug_when>
    <thetext>Adele and I figured out that the real problem here is that HTMLInputElement goes out of its way to give the default event handler a crack at the event before it handles the event. For &lt;input type=&quot;text&quot;&gt; that&apos;s OK, but not for other input types. This will be easy to fix.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114073</commentid>
    <comment_count>11</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-17 12:24:13 -0700</bug_when>
    <thetext>Testing the patch on the Mac now to make sure it doesn’t cause any behavior regressions. If not, I’ll put it up for review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>114078</commentid>
    <comment_count>12</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2009-03-17 12:44:46 -0700</bug_when>
    <thetext>http://trac.webkit.org/changeset/41781

Contrary to what the title said, this did *not* affect &lt;button&gt;. If there are problems with &lt;button&gt; elements those are a separate bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>28672</attachid>
            <date>2009-03-16 17:46:00 -0700</date>
            <delta_ts>2009-03-16 17:46:00 -0700</delta_ts>
            <desc>initial version of patch</desc>
            <filename>patch.txt</filename>
            <type>text/plain</type>
            <size>1244</size>
            <attacher name="Adele Peterson">adele</attacher>
            
              <data encoding="base64">SW5kZXg6IGh0bWwvSFRNTElucHV0RWxlbWVudC5jcHAKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQotLS0gaHRtbC9IVE1M
SW5wdXRFbGVtZW50LmNwcAkocmV2aXNpb24gNDE3MzgpCisrKyBodG1sL0hUTUxJbnB1dEVsZW1l
bnQuY3BwCSh3b3JraW5nIGNvcHkpCkBAIC0xMTE1LDggKzExMTUsMTAgQEAgdm9pZCBIVE1MSW5w
dXRFbGVtZW50OjpkZWZhdWx0RXZlbnRIYW5kbAogICAgICAgICByZXR1cm47CiAgICAgfQogICAg
IAotICAgIC8vIExldCB0aGUga2V5IGhhbmRsaW5nIGRvbmUgaW4gTm9kZSB0YWtlIHByZWNlZGVu
Y2Ugb3ZlciB0aGUgZXZlbnQgaGFuZGxpbmcgaGVyZSBmb3IgZWRpdGFibGUgdGV4dCBmaWVsZHMK
LSAgICBpZiAoIWNsaWNrRGVmYXVsdEZvcm1CdXR0b24pIHsKKyAgICAvLyBDYWxsIHRoZSBiYXNl
IGV2ZW50IGhhbmRsZXIgYmVmb3JlIGFueSBvZiBvdXIgb3duIGV2ZW50IGhhbmRsaW5nIGZvciBh
bG1vc3QgYWxsIGV2ZW50cyBpb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