Bug 233449

Summary: AX: range input does not fire input event when incremented/decremented via accessibility APIs
Product: WebKit Reporter: Weston Thayer <me>
Component: AccessibilityAssignee: Tyler Wilcock <tyler_w>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, akeerthi, andresg_22, apinheiro, cfleizach, dmazzoni, ews-watchlist, jcraig, samuel_white, tyler_w, webkit-bug-importer, webkit.org
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: All   
OS: All   
Attachments:
Description Flags
Basid range input logging input and change events
none
Patch
none
Patch none

Description Weston Thayer 2021-11-23 09:22:00 PST
Created attachment 445036 [details]
Basid range input logging input and change events

<input type=range> does not fire the 'input' event when using the OS accessibility action APIs to increment/decrement it's value. Both macOS and iOS VoiceOver use the increment/decrement actions. This can break code that relies on only the 'input' event to respond to the range input changing values.

1. Open either the attached chromebug-1272108.html or https://westonthayer.github.io/hosting/chromebug-1272107.html in Safari
2. Open Xcode Accessibility Inspector
3. Select the range input (you can use Accessibility Inspector's Point to Inspect crosshairs)
4. Accessibility Inspector's inspected element should have type: slider
5. Expand Accessibility Inspector's Actions menu and perform either the 'increment' or 'decrement' actions

Expected result:
The log below the range input should show both "input: NEW_VALUE" and "change: NEW_VALUE", just as it does if you use the mouse or keyboard to change the range input's value.

Actual result:
The log only shows "change: NEW_VALUE".
Comment 1 Radar WebKit Bug Importer 2021-11-23 09:22:13 PST
<rdar://problem/85707481>
Comment 2 Weston Thayer 2021-11-23 09:25:57 PST
I believe firing 'input' is required by the HTML spec: https://html.spec.whatwg.org/multipage/indices.html#event-input
Comment 3 Curtis Wilcox 2024-02-11 12:47:04 PST
This is still a problem on macOS 14.3 with Safari 17.3 and on iOS 17.3.1.

In practice, it's less of an issue with macOS as users likely change the value with up, down, left, right arrows without a modifier, triggering both events as any keyboard user would. The problem can still be replicated by navigating "In slider" (VO+Shift+down arrow) then using VO+up, down, left, right arrows; 'change' events are triggered but 'input' events are not.
Comment 4 Tyler Wilcock 2024-04-06 22:47:50 PDT
Created attachment 470797 [details]
Patch
Comment 5 Tyler Wilcock 2024-04-07 08:23:53 PDT
Created attachment 470801 [details]
Patch
Comment 6 EWS 2024-04-07 12:13:43 PDT
Committed 277182@main (87dc85177fd8): <https://commits.webkit.org/277182@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 470801 [details].