Bug 179496 - AX: AOM: Implement boolean type properties
Summary: AX: AOM: Implement boolean type properties
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 179255
  Show dependency treegraph
 
Reported: 2017-11-09 11:31 PST by Nan Wang
Modified: 2017-11-18 09:56 PST (History)
16 users (show)

See Also:


Attachments
patch (70.13 KB, patch)
2017-11-17 12:46 PST, Nan Wang
no flags Details | Formatted Diff | Diff
patch (70.16 KB, patch)
2017-11-17 12:52 PST, Nan Wang
no flags Details | Formatted Diff | Diff
patch (69.96 KB, patch)
2017-11-17 14:21 PST, Nan Wang
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Nan Wang 2017-11-09 11:31:30 PST
AOM Phase 1:
Implement boolean type properties

Spec: https://wicg.github.io/aom/spec/

<rdar://problem/35077917>
Comment 1 Nan Wang 2017-11-17 12:46:59 PST
Created attachment 327216 [details]
patch
Comment 2 Nan Wang 2017-11-17 12:52:07 PST
Created attachment 327217 [details]
patch

fix build
Comment 3 chris fleizach 2017-11-17 13:54:31 PST
Comment on attachment 327217 [details]
patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:120
> +static const Seconds accessibilityFocusAXModalNodeNotificationInterval { 50_ms };

I think the AX might be redundant, since we're already in the AX code base. I think that can just be removed
that comment applies to everything below here too

> Source/WebCore/accessibility/AccessibilityObject.cpp:2166
> +    return std::nullopt;

should we just return false here instead of using optionals?
do we check null opt anywhere?

> Source/WebCore/accessibility/AccessibleNode.cpp:124
> +    default:

we should remove the default case so we know everything is handled always

> Source/WebCore/accessibility/AccessibleNode.cpp:127
> +}

then we return false here

> LayoutTests/accessibility/mac/AOM-bool-properties.html:59
> +        shouldBeNull("node.accessibleNode.atomic");

is this expected behavior? or should it return false?
Comment 4 Nan Wang 2017-11-17 13:59:18 PST
Comment on attachment 327217 [details]
patch

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

>> Source/WebCore/accessibility/AXObjectCache.cpp:120
>> +static const Seconds accessibilityFocusAXModalNodeNotificationInterval { 50_ms };
> 
> I think the AX might be redundant, since we're already in the AX code base. I think that can just be removed
> that comment applies to everything below here too

Ok I will change this except for AXHidden since we do have another isHidden() check

>> Source/WebCore/accessibility/AccessibilityObject.cpp:2166
>> +    return std::nullopt;
> 
> should we just return false here instead of using optionals?
> do we check null opt anywhere?

Yes we check this at all the places to make sure the property is actually being set

>> Source/WebCore/accessibility/AccessibleNode.cpp:127
>> +}
> 
> then we return false here

Ok

>> LayoutTests/accessibility/mac/AOM-bool-properties.html:59
>> +        shouldBeNull("node.accessibleNode.atomic");
> 
> is this expected behavior? or should it return false?

Yes by default all the property value should be null.
Comment 5 Nan Wang 2017-11-17 14:08:25 PST
Comment on attachment 327217 [details]
patch

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

>>> Source/WebCore/accessibility/AccessibleNode.cpp:127
>>> +}
>> 
>> then we return false here
> 
> Ok

Actually this is giving an error "17 enumeration values not handled in switch:" if without the default case
Comment 6 chris fleizach 2017-11-17 14:16:38 PST
Comment on attachment 327217 [details]
patch

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

>>>> Source/WebCore/accessibility/AccessibleNode.cpp:127
>>>> +}
>>> 
>>> then we return false here
>> 
>> Ok
> 
> Actually this is giving an error "17 enumeration values not handled in switch:" if without the default case

what are the unhandled values? all the string values?
Comment 7 Nan Wang 2017-11-17 14:17:27 PST
(In reply to chris fleizach from comment #6)
> Comment on attachment 327217 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=327217&action=review
> 
> >>>> Source/WebCore/accessibility/AccessibleNode.cpp:127
> >>>> +}
> >>> 
> >>> then we return false here
> >> 
> >> Ok
> > 
> > Actually this is giving an error "17 enumeration values not handled in switch:" if without the default case
> 
> what are the unhandled values? all the string values?

enum class items
Comment 8 Nan Wang 2017-11-17 14:18:28 PST
(In reply to Nan Wang from comment #7)
> (In reply to chris fleizach from comment #6)
> > Comment on attachment 327217 [details]
> > patch
> > 
> > View in context:
> > https://bugs.webkit.org/attachment.cgi?id=327217&action=review
> > 
> > >>>> Source/WebCore/accessibility/AccessibleNode.cpp:127
> > >>>> +}
> > >>> 
> > >>> then we return false here
> > >> 
> > >> Ok
> > > 
> > > Actually this is giving an error "17 enumeration values not handled in switch:" if without the default case
> > 
> > what are the unhandled values? all the string values?
> 
> enum class items

AXPropertyName::None, AXPropertyName::Autocomplete, etc.
Comment 9 Nan Wang 2017-11-17 14:21:58 PST
Created attachment 327237 [details]
patch

Removed redundant "AX" prefix
Comment 10 chris fleizach 2017-11-17 14:38:49 PST
Comment on attachment 327237 [details]
patch

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

> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3200
> +        return [NSNumber numberWithBool:m_object->ariaIsMultiline()];

there must be iOS changes required too right?

> LayoutTests/accessibility/mac/AOM-bool-properties.html:144
> +    function testRequired() {

missing tests for 
Atomic
Busy
Comment 11 Nan Wang 2017-11-17 14:43:50 PST
Comment on attachment 327237 [details]
patch

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

>> Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm:3200
>> +        return [NSNumber numberWithBool:m_object->ariaIsMultiline()];
> 
> there must be iOS changes required too right?

I only added this to support test and the test is only available on Mac. 
I think we might need to expose more stuff in future to make this test cross platform. Right now I just used the macOS attribute names to test most properties.

>> LayoutTests/accessibility/mac/AOM-bool-properties.html:144
>> +    function testRequired() {
> 
> missing tests for 
> Atomic
> Busy

Atomic is covered in testClearBooleanProperty().
and there is a testBusy();
Comment 12 WebKit Commit Bot 2017-11-17 15:14:22 PST
Comment on attachment 327237 [details]
patch

Clearing flags on attachment: 327237

Committed r224992: <https://trac.webkit.org/changeset/224992>
Comment 13 WebKit Commit Bot 2017-11-17 15:14:23 PST
All reviewed patches have been landed.  Closing bug.
Comment 14 Ryosuke Niwa 2017-11-18 01:58:32 PST
Comment on attachment 327237 [details]
patch

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

> Source/WebCore/accessibility/AXObjectCache.cpp:2885
> +            std::optional<bool> hiddenValue = AccessibleNode::effectiveBoolValueForElement(downcast<Element>(*testNode), AXPropertyName::Hidden);

Use auto in these cases.

> Source/WebCore/accessibility/AccessibilityARIAGrid.cpp:85
> +    std::optional<bool> multiSelectable = boolValueForProperty(AXPropertyName::Multiselectable);

Use auto.

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:628
> +        if (std::optional<bool> disabled = object->boolValueForProperty(AXPropertyName::Disabled)) {

Use auto.

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:707
> +    std::optional<bool> multiSelectable = boolValueForProperty(AXPropertyName::Multiselectable);

Use auto.
Comment 15 Nan Wang 2017-11-18 09:56:26 PST
(In reply to Ryosuke Niwa from comment #14)
> Comment on attachment 327237 [details]
> patch
> 
> View in context:
> https://bugs.webkit.org/attachment.cgi?id=327237&action=review
> 
> > Source/WebCore/accessibility/AXObjectCache.cpp:2885
> > +            std::optional<bool> hiddenValue = AccessibleNode::effectiveBoolValueForElement(downcast<Element>(*testNode), AXPropertyName::Hidden);
> 
> Use auto in these cases.
> 
> > Source/WebCore/accessibility/AccessibilityARIAGrid.cpp:85
> > +    std::optional<bool> multiSelectable = boolValueForProperty(AXPropertyName::Multiselectable);
> 
> Use auto.
> 
> > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:628
> > +        if (std::optional<bool> disabled = object->boolValueForProperty(AXPropertyName::Disabled)) {
> 
> Use auto.
> 
> > Source/WebCore/accessibility/AccessibilityNodeObject.cpp:707
> > +    std::optional<bool> multiSelectable = boolValueForProperty(AXPropertyName::Multiselectable);
> 
> Use auto.

Ok I will update these in https://bugs.webkit.org/show_bug.cgi?id=179497