Bug 162269

Summary: AX: aria-pressed state not correctly conveyed to VoiceOver iOS on <button> unless role=button added
Product: WebKit Reporter: Paul J. Adam <paul>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Major CC: aboxhall, apinheiro, cfleizach, commit-queue, dmazzoni, jcraig, jdiggs, mario, n_wang, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Local Build   
Hardware: iPhone / iPad   
OS: iOS 10   
Attachments:
Description Flags
patch
none
patch
cfleizach: review+
patch none

Description Paul J. Adam 2016-09-20 08:26:48 PDT
Overview:
When aria-pressed is set on a native HTML <button> element the state is not conveyed to VoiceOver iOS 10, however, if the extra role="button" attribute/value is added to the <button> tag, e.g. <button aria-pressed="true" role="button"> works but <button aria-pressed="true"> does not work. 

Steps to Reproduce:
1. Turn on VoiceOver on iOS 10.
2. Visit http://pauljadam.com/demos/button.html in Safari iOS
3. Activate the aria-pressed button example under the aria-pressed heading.
4. Notice that aria-pressed button is now visually styled to look pressed and the aria-pressed attribute has been updated to equal "true". 
5. Set VoiceOver focus to the newly pressed button.

Expected Results:
VoiceOver speaks "aria-pressed Toggle button Pressed Double tap to toggle setting."

Actual Results:
VoiceOver speaks "aria-pressed Toggle button Not pressed Double tap to toggle setting."

Additional Information:
The second aria-pressed role iOS bug button works properly because the extra aria-pressed="true" attribute/value is added.
Comment 1 Radar WebKit Bug Importer 2016-09-20 08:27:13 PDT
<rdar://problem/28386813>
Comment 2 Nan Wang 2016-09-21 16:32:02 PDT
Created attachment 289487 [details]
patch
Comment 3 Nan Wang 2016-09-21 17:17:05 PDT
Created attachment 289493 [details]
patch

fixed failure test.
Comment 4 chris fleizach 2016-09-21 17:44:22 PDT
(In reply to comment #3)
> Created attachment 289493 [details]
> patch
> 
> fixed failure test.

looks like still failing. r=me when tests pass
Comment 5 Nan Wang 2016-09-21 17:49:56 PDT
Created attachment 289496 [details]
patch

I accidentally included an unwanted file. Fixed that
Comment 6 WebKit Commit Bot 2016-09-22 08:16:43 PDT
Comment on attachment 289496 [details]
patch

Clearing flags on attachment: 289496

Committed r206259: <http://trac.webkit.org/changeset/206259>
Comment 7 WebKit Commit Bot 2016-09-22 08:16:48 PDT
All reviewed patches have been landed.  Closing bug.