<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>28985</bug_id>
          
          <creation_ts>2015-07-23 08:37:23 +0000</creation_ts>
          <short_desc>Ordering of checkbox click &amp; change events doesn&apos;t match reality</short_desc>
          <delta_ts>2016-01-18 10:09:47 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WHATWG</product>
          <component>HTML</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          <see_also>https://bugzilla.mozilla.org/show_bug.cgi?id=843554</see_also>
    
    <see_also>https://bugs.webkit.org/show_bug.cgi?id=93674</see_also>
          <bug_file_loc>http://jsfiddle.net/cvrebert/Lxwc1eah/show/</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>Unsorted</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Chris Rebert">w3bugs</reporter>
          <assigned_to name="Ian &apos;Hixie&apos; Hickson">ian</assigned_to>
          <cc>annevk</cc>
    
    <cc>hsteen</cc>
    
    <cc>mike</cc>
          
          <qa_contact>contributor</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>122267</commentid>
    <comment_count>0</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2015-07-23 08:37:23 +0000</bug_when>
    <thetext>To repro:
1. Open http://jsfiddle.net/cvrebert/Lxwc1eah/show/
2. Open the console
3. Click the webpage&apos;s checkbox
4. Observe the console output

In Chrome, Safari, and IE11, the output is:
  change
  click
In Firefox only, the output is:
  click
  change

The majority position is that, when the user clicks an &lt;input type=&quot;checkbox&quot;&gt;, the `change` event gets fired before the `click` event. Firefox does the reverse. The spec currently agrees with Firefox but disagrees with the majority.


Here are the relevant portions of the spec:

https://html.spec.whatwg.org/multipage/interaction.html#run-authentic-click-activation-steps
When a user agent is to [[[run authentic click activation steps]]] for a given event event, it must follow these steps:
    [...]
    6. Dispatch event (the required `click` event) at target.
       If there is an element e and the `click` event is not canceled, [[[run post-click activation steps]]] on element e.

https://html.spec.whatwg.org/multipage/interaction.html#run-post-click-activation-steps
When a user agent is to [[[run post-click activation steps]]] on an element, it must run the [[[activation behaviour]]] defined for that element, if any.

https://html.spec.whatwg.org/multipage/forms.html#checkbox-state-(type=checkbox):activation-behaviour
4.10.5.1.16 Checkbox state (type=checkbox)
    The [[[activation behaviour]]] is to fire a simple event that bubbles named `input` at the element and then fire a simple event that bubbles named `change` at the element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124505</commentid>
    <comment_count>1</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-01-03 07:57:09 +0000</bug_when>
    <thetext>Safari 9.0.2&apos;s behavior is unchanged.
MS Edge behaves the same as IE11.
Chrome 47 has apparently switched to behaving like Firefox.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124506</commentid>
    <comment_count>2</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-01-03 07:57:55 +0000</bug_when>
    <thetext>Bloody dropdowns..</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124507</commentid>
    <comment_count>3</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-01-03 08:08:19 +0000</bug_when>
    <thetext>And `click` comes first in Opera 12.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124613</commentid>
    <comment_count>4</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-01-18 09:57:18 +0000</bug_when>
    <thetext>Filed MS Edge bug:
https://connect.microsoft.com/IE/feedback/details/2255779</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>124614</commentid>
    <comment_count>5</comment_count>
    <who name="Chris Rebert">w3bugs</who>
    <bug_when>2016-01-18 10:09:47 +0000</bug_when>
    <thetext>Deeming this to now be a bug in the remaining browsers rather than the spec itself, since 2 browsers now match the spec and Safari appears open to changing to match the spec (hopefully Edge will respond positively too).
(And the spec&apos;s behavior is certainly more logical than the alternative behavior, so now that compat is less of a factor, there&apos;s no reason to want the spec to change.)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>