<?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>227700</bug_id>
          
          <creation_ts>2021-07-06 03:39:12 -0700</creation_ts>
          <short_desc>Inconsistent &apos;change&apos; event dispatch on color input</short_desc>
          <delta_ts>2021-07-07 11:49:17 -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>Safari 14</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 11</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Dan">dan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>akeerthi</cc>
    
    <cc>cdumez</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>wenson_hsieh</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1774914</commentid>
    <comment_count>0</comment_count>
      <attachid>432916</attachid>
    <who name="Dan">dan</who>
    <bug_when>2021-07-06 03:39:12 -0700</bug_when>
    <thetext>Created attachment 432916
&apos;input&apos; and &apos;change&apos; events on &lt;input type=color&gt;

&lt;input type=color/&gt; opens a popup containing color swatches. Clicking on any color swatch produces an `input` event, followed by a `change` event and (crucially) closes the popup. 

The _Show colors..._ button opens up the macOS native color picker. Dragging the cursor around the color wheel produces pairs of `input` and `change` events. I believe `change` event should be reserved to the user committing the value change by dismissing the color picker. This would be consistent with behaviors in both Chrome/macOS and Firefox/macOS. 

Attached for convenience is a simple test case with a color input that logs its `input` and `change` events in the browser console.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774915</commentid>
    <comment_count>1</comment_count>
    <who name="Dan">dan</who>
    <bug_when>2021-07-06 03:56:03 -0700</bug_when>
    <thetext>Related Google Chrome issue, marked as fixed: https://bugs.chromium.org/p/chromium/issues/detail?id=405059</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774932</commentid>
    <comment_count>2</comment_count>
    <who name="Sam Sneddon [:gsnedders]">gsnedders</who>
    <bug_when>2021-07-06 07:05:29 -0700</bug_when>
    <thetext>Per https://html.spec.whatwg.org/multipage/input.html#common-input-element-events:

&gt; The change event fires when the value is committed, if that makes sense for the control, or else when the control loses focus.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1774933</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-07-06 07:05:42 -0700</bug_when>
    <thetext>&lt;rdar://problem/80208921&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>432916</attachid>
            <date>2021-07-06 03:39:12 -0700</date>
            <delta_ts>2021-07-06 03:39:12 -0700</delta_ts>
            <desc>&apos;input&apos; and &apos;change&apos; events on &lt;input type=color&gt;</desc>
            <filename>color-input-events.html</filename>
            <type>text/html</type>
            <size>456</size>
            <attacher name="Dan">dan</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sPgo8aGVhZD4KCTxtZXRhIGNoYXJzZXQ9InV0Zi04Ij4KCTx0
aXRsZT5IVE1MIGNvbG9yIGlucHV0czogRE9NIGV2ZW50IHRlc3RzPC90aXRsZT4KCTxzdHlsZT4K
CQlib2R5IHsKCQkJaGVpZ2h0OiAyMDB2aDsKCQl9Cgk8L3N0eWxlPgo8L2hlYWQ+Cjxib2R5PgoJ
PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiPgoJCWxldCBlbCA9IGRvY3VtZW50LmNyZWF0
ZUVsZW1lbnQoJ2lucHV0Jyk7CgkJZWwudHlwZSA9ICdjb2xvcic7CgkJZG9jdW1lbnQuYm9keS5h
cHBlbmRDaGlsZChlbCk7CgkJbGV0IGZuID0gZSA9PiBjb25zb2xlLmxvZyhlLnR5cGUsIGUudGFy
Z2V0LnZhbHVlLCBlKTsKCQllbC5hZGRFdmVudExpc3RlbmVyKCdjaGFuZ2UnLCBmbik7CgkJZWwu
YWRkRXZlbnRMaXN0ZW5lcignaW5wdXQnLCBmbik7Cgk8L3NjcmlwdD4KPC9ib2R5Pgo8L2h0bWw+
</data>

          </attachment>
      

    </bug>

</bugzilla>