<?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>4573</bug_id>
          
          <creation_ts>2005-08-21 17:43:06 -0700</creation_ts>
          <short_desc>click DOM method not working on check boxes or radio buttons</short_desc>
          <delta_ts>2005-09-04 13:05:53 -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>420+</version>
          <rep_platform>Mac</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></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>4565</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Darin Adler">darin</reporter>
          <assigned_to name="Darin Adler">darin</assigned_to>
          <cc>andersca</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>17073</commentid>
    <comment_count>0</comment_count>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-21 17:43:06 -0700</bug_when>
    <thetext>After the recent changes to forms, the &quot;click&quot; DOM method isn&apos;t working any more. This is breaking the 
HTMLInputElement21 test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17075</commentid>
    <comment_count>1</comment_count>
      <attachid>3496</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-21 17:51:10 -0700</bug_when>
    <thetext>Created attachment 3496
patch to check on khtmlClick rather than click, not insist on a mouse event</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17076</commentid>
    <comment_count>2</comment_count>
      <attachid>3496</attachid>
    <who name="Darin Adler">darin</who>
    <bug_when>2005-08-21 17:51:38 -0700</bug_when>
    <thetext>Comment on attachment 3496
patch to check on khtmlClick rather than click, not insist on a mouse event

I need Dave&apos;s input on whether this is the right way to fix this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17825</commentid>
    <comment_count>3</comment_count>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-08-28 19:53:30 -0700</bug_when>
    <thetext>The change itself looks ok, however, I think the whole pre-dispatch event handling concept may be bogus. 
Other browsers will allow the click event handler for a radio button or checkbox to prevent the default 
action of toggling its checked state.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17827</commentid>
    <comment_count>4</comment_count>
      <attachid>3496</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-08-28 23:11:54 -0700</bug_when>
    <thetext>Comment on attachment 3496
patch to check on khtmlClick rather than click, not insist on a mouse event

Assuming you tested this with both click() and real mouse clicks, r=me. However
- our handling here is somewhat wrong. 

Preventing default in or returning false from a mouse handler will not prevent
the checkbox or radio button from being checked, and it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17828</commentid>
    <comment_count>5</comment_count>
      <attachid>3496</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-08-28 23:18:26 -0700</bug_when>
    <thetext>Comment on attachment 3496
patch to check on khtmlClick rather than click, not insist on a mouse event

Assuming you tested this with both click() and real mouse clicks, r=me. However
- our handling here is somewhat wrong. 

Preventing default in or returning false from a mouse handler will not prevent
the checkbox or radio button from being checked, and it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17829</commentid>
    <comment_count>6</comment_count>
      <attachid>3496</attachid>
    <who name="Maciej Stachowiak">mjs</who>
    <bug_when>2005-08-28 23:34:47 -0700</bug_when>
    <thetext>Comment on attachment 3496
patch to check on khtmlClick rather than click, not insist on a mouse event

Assuming you tested this with both click() and real mouse clicks, r=me. However
- our handling here is somewhat wrong. 

Preventing default in or returning false from a mouse handler will not prevent
the checkbox or radio button from being checked, and it should.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17981</commentid>
    <comment_count>7</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-08-30 15:32:42 -0700</bug_when>
    <thetext>Actually it&apos;s much weirder than that.  onmousedown preventDefault does not stop checking.  onclick 
preventDefault actually *reverses* the checking/unchecking in WinIE and Firefox.  In other words you let 
the checking/unchecking happen and then undo it!  I&apos;m not sure if this is going to be necessary or not...

Anyway, r- on the patch since the real bug is just that the click method was sending a KHTML_CLICK and 
not a real CLICK event.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17982</commentid>
    <comment_count>8</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-08-30 15:33:45 -0700</bug_when>
    <thetext>KHTML_CLICK needs to be eliminated as well, since its presence causes onclick to fire at the wrong time, 
after bubbling has happened in the real DOM.  I&apos;m going to file a follow-up bug to eliminate 
KHTML_CLICK.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>17983</commentid>
    <comment_count>9</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2005-08-30 15:57:04 -0700</bug_when>
    <thetext>Fixed.
</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>3496</attachid>
            <date>2005-08-21 17:51:10 -0700</date>
            <delta_ts>2005-08-30 15:31:10 -0700</delta_ts>
            <desc>patch to check on khtmlClick rather than click, not insist on a mouse event</desc>
            <filename>ClickPatch.txt</filename>
            <type>text/plain</type>
            <size>1635</size>
            <attacher name="Darin Adler">darin</attacher>
            
              <data encoding="base64">SW5kZXg6IGtodG1sL2h0bWwvaHRtbF9mb3JtaW1wbC5jcHAKPT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PQpSQ1MgZmlsZT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GVjdGVk
LnR4dAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAvY3ZzL3Jvb3QvV2ViQ29yZS9sYXlvdXQtdGVzdHMv
ZG9tL2h0bWwvbGV2ZWwyL2h0bWwvSFRNTElucHV0RWxlbWVudDIxLWV4cGVjdGVkLnR4dCx2CnJl
dHJpZXZpbmcgcmV2aXNpb24gMS4xCmRpZmYgLXAgLXUgLXIxLjEgbGF5b3V0LXRlc3RzL2RvbS9o
dG1sL2xldmVsMi9odG1sL0hUTUxJbnB1dEVsZW1lbnQyMS1leHBlY3RlZC50eHQKLS0tIGxheW91
dC10ZXN0cy9kb20vaHRtbC9sZXZlbDIvaHRtbC9IVE1MSW5wdXRFbGVtZW50MjEtZXhwZWN0ZWQu
dHh0CTI2IEp1bCAyMDA1IDA4OjM1OjQyIC0wMDAwCTEuMQorKysgbGF5b3V0LXRlc3RzL2RvbS9o
dG1sL2xldmVsMi9odG1sL0hUTUxJbnB1dEVsZW1lbnQyMS1leHBlY3RlZC50eHQJMjIgQXVnIDIw
MDUgMDA6NTI6MzUgLTAwMDAKQEAgLTEsMyArMSwyIEBACi1UZXN0OglodHRwOi8vd3d3LnczLm9y
Zy8yMDAxL0RPTS1UZXN0LVN1aXRlL2xldmVsMi9odG1sL0hUTUxJbnB1dEVsZW1lbnQyMQkKLVN0
YXR1czoJZmFpbHVyZQotRGV0YWlsOgljaGVja2VkQWZ0ZXJDbGljazogYXNzZXJ0VHJ1ZSBmYWls
ZWQKK1Rlc3Q6CWh0dHA6Ly93d3cudzMub3JnLzIwMDEvRE9NLVRlc3QtU3VpdGUvbGV2ZWwyL2h0
bWwvSFRNTElucHV0RWxlbWVudDIxCitTdGF0dXM6CVN1Y2Nlc3MK
</data>
<flag name="review"
          id="416"
          type_id="1"
          status="-"
          setter="hyatt"
    />
          </attachment>
      

    </bug>

</bugzilla>