<?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>232202</bug_id>
          
          <creation_ts>2021-10-23 11:34:15 -0700</creation_ts>
          <short_desc>&quot;Clicking&quot; option element via WebDriver the second time doesn&apos;t fire change event</short_desc>
          <delta_ts>2021-10-30 11:35:15 -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>WebDriver</component>
          <version>Other</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Linux</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="Pochang Chen">johnchen902</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bburg</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1808096</commentid>
    <comment_count>0</comment_count>
      <attachid>442270</attachid>
    <who name="Pochang Chen">johnchen902</who>
    <bug_when>2021-10-23 11:34:15 -0700</bug_when>
    <thetext>Created attachment 442270
Python script to reproduce the problem.

&quot;Clicking&quot; option element via WebDriver the second time doesn&apos;t fire change event, even though the selection has been changed via JavaScript.

Steps to Reproduce (see the attached script):
1. Create a &lt;select&gt; with two &lt;option&gt;
2. Listen to the change event of the &lt;select&gt;
3. Select (&quot;click&quot;) the second &lt;option&gt; via WebDriver
4. Select the first &lt;option&gt; via JavaScript
5. Select (&quot;click&quot;) the second &lt;option&gt; via WebDriver

Expected Results: A change event is fired at step 5

Actual Results: No change event is fired at step 5

My environment:
* Arch Linux
* webkit2gtk 2.32.4-1
* python 3.9.7-1
* python-selenium 3.141.0-3

My educated guess is that WebKit::WebAutomationSessionProxy::selectOptionElement should call WebCore::HTMLSelectElement::saveLastSelection before calling WebCore::HTMLSelectElement::optionSelectedByUser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810435</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-10-30 11:35:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/84841212&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>442270</attachid>
            <date>2021-10-23 11:34:15 -0700</date>
            <delta_ts>2021-10-23 11:34:15 -0700</delta_ts>
            <desc>Python script to reproduce the problem.</desc>
            <filename>file_232202.txt</filename>
            <type>text/plain</type>
            <size>1038</size>
            <attacher name="Pochang Chen">johnchen902</attacher>
            
              <data encoding="base64">aW1wb3J0IHNlbGVuaXVtLndlYmRyaXZlcg0KaW1wb3J0IHRlbXBmaWxlDQoNCmRlZiBydW5fd2Vi
ZHJpdmVyKHVybCk6DQogICAgd2l0aCBzZWxlbml1bS53ZWJkcml2ZXIuV2ViS2l0R1RLKCkgYXMg
ZHJpdmVyOg0KICAgICMgd2l0aCBzZWxlbml1bS53ZWJkcml2ZXIuRmlyZWZveCgpIGFzIGRyaXZl
cjoNCiAgICAgICAgZHJpdmVyLmdldCh1cmwpDQogICAgICAgIGRyaXZlci5leGVjdXRlX3Njcmlw
dCgnJycNCiAgICAgICAgICAgIHdpbmRvdy5DT1VOVCA9IDA7DQogICAgICAgICAgICBmb28uYWRk
RXZlbnRMaXN0ZW5lcignY2hhbmdlJywgKGUpID0+IHdpbmRvdy5DT1VOVCsrKTsNCiAgICAgICAg
JycnKQ0KICAgICAgICBiYXIgPSBkcml2ZXIuZmluZF9lbGVtZW50X2J5X2lkKCdiYXInKQ0KICAg
ICAgICBiYXIuY2xpY2soKQ0KICAgICAgICBkcml2ZXIuZXhlY3V0ZV9zY3JpcHQoImZvby52YWx1
ZSA9ICcwJyIpDQogICAgICAgICMgZHJpdmVyLmV4ZWN1dGVfc2NyaXB0KCJmb28uZm9jdXMoKSIp
DQogICAgICAgIGJhci5jbGljaygpDQogICAgICAgIHByaW50KCdFeHBlY3RlZCAyLCBmb3VuZCcs
IGRyaXZlci5leGVjdXRlX3NjcmlwdCgncmV0dXJuIENPVU5UJykpDQoNCmRlZiBtYWluKCk6DQog
ICAgd2l0aCB0ZW1wZmlsZS5OYW1lZFRlbXBvcmFyeUZpbGUoc3VmZml4PScuaHRtbCcpIGFzIGY6
DQogICAgICAgIGYud3JpdGUoYicnJw0KICAgICAgICAgICAgPCFET0NUWVBFIGh0bWw+DQogICAg
ICAgICAgICA8dGl0bGU+eDwvdGl0bGU+DQogICAgICAgICAgICA8c2VsZWN0IGlkPSJmb28iPg0K
ICAgICAgICAgICAgICAgIDxvcHRpb24gdmFsdWU9IjAiPjA8L29wdGlvbj4NCiAgICAgICAgICAg
ICAgICA8b3B0aW9uIGlkPSJiYXIiIHZhbHVlPSIxIj4xPC9vcHRpb24+DQogICAgICAgICAgICA8
L3NlbGVjdD4NCiAgICAgICAgJycnKQ0KICAgICAgICBmLmZsdXNoKCkNCiAgICAgICAgcnVuX3dl
YmRyaXZlcignZmlsZTovLycgKyBmLm5hbWUpDQoNCmlmIF9fbmFtZV9fID09ICdfX21haW5fXyc6
DQogICAgbWFpbigp
</data>

          </attachment>
      

    </bug>

</bugzilla>