Bug 120372 - AX: AXValue/AXMenuItemMarkChar not defined for menuitemradio (should be false (0) with aria-checked=mixed | undefined)
Summary: AX: AXValue/AXMenuItemMarkChar not defined for menuitemradio (should be false...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: chris fleizach
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2013-08-27 13:37 PDT by Jon Gunderson
Modified: 2013-09-10 16:49 PDT (History)
9 users (show)

See Also:


Attachments
patch (5.19 KB, patch)
2013-09-04 14:17 PDT, chris fleizach
no flags Details | Formatted Diff | Diff
patch (13.25 KB, patch)
2013-09-09 15:24 PDT, chris fleizach
mario: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jon Gunderson 2013-08-27 13:37:42 PDT
According to the ARIA specification when ARIA role=menuitemradio has a aria-checked="mixed" property the AXvalue should be exposed and have the value=0

ARIA Test Case 344:
https://www.w3.org/WAI/PF/testharness/testcases/edit?testsuite_id=1&testcase_id=344 

ARIA Test Case 345:
https://www.w3.org/WAI/PF/testharness/testcases/edit?testsuite_id=1&testcase_id=345 

This is an important for requirement for ARIA 1.0 to move to recommendation status
Comment 1 Radar WebKit Bug Importer 2013-08-27 13:38:06 PDT
<rdar://problem/14848449>
Comment 2 chris fleizach 2013-09-04 14:17:11 PDT
Created attachment 210495 [details]
patch
Comment 4 James Craig 2013-09-05 16:52:12 PDT
Hold off on the commit-queue+ on this one for now. ARIA spec has a weird rule related to this one that the WG is discussing at the moment. It explicitly says to ignored the mixed state one menuitems for 1.0, but it's possible this will change in 1.1. The included patch may need to be updated depending on the outcome.
Comment 5 James Craig 2013-09-05 16:54:34 PDT
Follow-up from last comment: 

Here's the text, but I'm not yet sure I agree with this behavior.

"The mixed value is not supported on radio or menuitemradio or any element that inherits from these in the taxonomy, and user agents MUST treat a mixed value as equivalent to false for those roles."

Cite: http://www.w3.org/WAI/PF/aria/complete#aria-checked
Comment 6 chris fleizach 2013-09-05 16:55:24 PDT
(In reply to comment #5)
> Follow-up from last comment: 
> 
> Here's the text, but I'm not yet sure I agree with this behavior.
> 
> "The mixed value is not supported on radio or menuitemradio or any element that inherits from these in the taxonomy, and user agents MUST treat a mixed value as equivalent to false for those roles."
> 
> Cite: http://www.w3.org/WAI/PF/aria/complete#aria-checked

So is this assessment final then for ARIA 1.0?
Comment 7 James Craig 2013-09-05 17:01:11 PDT
Yes. Short of a major event, 1.0 is locked down. If you like, you can commit an updated patch matching the speced 1.0 behavior… Just be aware that it may change in the future.
Comment 8 James Craig 2013-09-05 17:04:24 PDT
Ah, I see the discrepancy now. "mixed" is supported on both checkbox and menuitemcheckbox, but not radio or menuitemradio. Given that clarification, I think that behavior is correct and this is unlikely to change in ARIA 1.1. I was probably just misreading the spec.
Comment 9 chris fleizach 2013-09-05 17:05:41 PDT
(In reply to comment #8)
> Ah, I see the discrepancy now. "mixed" is supported on both checkbox and menuitemcheckbox, but not radio or menuitemradio. Given that clarification, I think that behavior is correct and this is unlikely to change in ARIA 1.1. I was probably just misreading the spec.

So it sounds like we still need to fix this bug, but we can't return a mixed state for some items..
Comment 10 James Craig 2013-09-06 09:53:50 PDT
(In reply to comment #9)

> So it sounds like we still need to fix this bug, but we can't return a mixed state for some items..

If I'm understanding you correctly, you're saying the above patch is valid because it changes AXValue from undefined, to 0 (false), 1 (true), or 2 (mixed), which accounts for part of the fix, but the bug report was specifically about the mixed state for menuitemradio (and radio) should be equivalent to false. So the patch is incomplete.
Comment 11 James Craig 2013-09-09 07:55:10 PDT
Also, your patch is missing AXMenuItemMarkChar ✓, which is how we'd expect to see the "checked" state on menuitemradio and menuitemcheckbox
Comment 12 chris fleizach 2013-09-09 14:42:45 PDT
(In reply to comment #11)
> Also, your patch is missing AXMenuItemMarkChar ✓, which is how we'd expect to see the "checked" state on menuitemradio and menuitemcheckbox

This should already be working correctly
Comment 13 chris fleizach 2013-09-09 15:24:42 PDT
Created attachment 211104 [details]
patch

New patch to make sure that radio and menu item radio do NOT expose mixed states
Comment 14 Mario Sanchez Prada 2013-09-10 13:43:03 PDT
Comment on attachment 211104 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=211104&action=review

Looks good to me. Just fix the path for the JS resources before landing, and maybe consider my comment about the duplicate line.

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1212
>          [tempArray addObject:NSAccessibilitySelectedAttribute];
> +        [tempArray addObject:NSAccessibilitySelectedAttribute];

Are you adding this duplicate line intentionally, or is it a mistake?

> LayoutTests/platform/mac/accessibility/menu-item-values.html:4
> +<script src="../../../fast/js/resources/js-test-pre.js"></script>

This path should be ../../../resources/js-test-pre.js now, as those JS resources have been moved there along with r155411

> LayoutTests/platform/mac/accessibility/menu-item-values.html:46
> +<script src="../../../fast/js/resources/js-test-post.js"></script>

Same here, but for ../../../resources/js-test-post.js
Comment 15 chris fleizach 2013-09-10 13:44:47 PDT
Comment on attachment 211104 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=211104&action=review

>> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:1212
>> +        [tempArray addObject:NSAccessibilitySelectedAttribute];
> 
> Are you adding this duplicate line intentionally, or is it a mistake?

Yea this looks wrong, i'll fix that
Comment 16 chris fleizach 2013-09-10 16:49:16 PDT
http://trac.webkit.org/changeset/155492