Bug 232202 - "Clicking" option element via WebDriver the second time doesn't fire change event
Summary: "Clicking" option element via WebDriver the second time doesn't fire change e...
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebDriver (show other bugs)
Version: Other
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-10-23 11:34 PDT by Pochang Chen
Modified: 2021-10-30 11:35 PDT (History)
2 users (show)

See Also:


Attachments
Python script to reproduce the problem. (1.01 KB, text/plain)
2021-10-23 11:34 PDT, Pochang Chen
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Pochang Chen 2021-10-23 11:34:15 PDT
Created attachment 442270 [details]
Python script to reproduce the problem.

"Clicking" option element via WebDriver the second time doesn't fire change event, even though the selection has been changed via JavaScript.

Steps to Reproduce (see the attached script):
1. Create a <select> with two <option>
2. Listen to the change event of the <select>
3. Select ("click") the second <option> via WebDriver
4. Select the first <option> via JavaScript
5. Select ("click") the second <option> 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.
Comment 1 Radar WebKit Bug Importer 2021-10-30 11:35:15 PDT
<rdar://problem/84841212>