Bug 179495

Summary: AX: AOM: Implement string type properties
Product: WebKit Reporter: Nan Wang <n_wang>
Component: AccessibilityAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, buildbot, cdumez, cfleizach, commit-queue, dmazzoni, esprehn+autocc, ews-watchlist, jcraig, jdiggs, joepeck, kondapallykalyan, n_wang, rniwa, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
See Also: https://bugs.webkit.org/show_bug.cgi?id=179255
Bug Depends on:    
Bug Blocks: 179255    
Attachments:
Description Flags
patch
none
patch none

Description Nan Wang 2017-11-09 11:27:52 PST
AOM Phase 1:
Implement all of the string type properties.

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

<rdar://problems/35077884>
Comment 1 Nan Wang 2017-11-16 13:28:04 PST
Created attachment 327101 [details]
patch
Comment 2 chris fleizach 2017-11-16 15:51:39 PST
Comment on attachment 327101 [details]
patch

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

> Source/WebCore/accessibility/AccessibilityObject.cpp:2500
> +    const AtomicString& ariaPlaceholder = stringValueForProperty(AXPropertyName::Placeholder);

if this is still atomic why did the return type change?

> Source/WebCore/accessibility/AccessibilityObject.h:704
> +    const String ariaKeyShortcutsValue() const;

should we remove aria as a prefix since this does AOM and aria

> Source/WebCore/accessibility/AccessibilityObject.h:985
> +    virtual const String ariaLiveRegionRelevant() const { return nullAtom(); }

ditto about these method names with aria
Comment 3 Nan Wang 2017-11-16 15:59:12 PST
Comment on attachment 327101 [details]
patch

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

>> Source/WebCore/accessibility/AccessibilityObject.cpp:2500
>> +    const AtomicString& ariaPlaceholder = stringValueForProperty(AXPropertyName::Placeholder);
> 
> if this is still atomic why did the return type change?

Because stringValueForProperty() is not returning the reference, so here if we don't change it would be error that returning reference to local temporary object.
const AtomicString& ariaPlaceholder = stringValueForProperty(AXPropertyName::Placeholder); is to prolong the lifetime of the String object within this function.
I tried to change stringValueForProperty() by returning a reference, but getting the string value that's being set from JS would hit the assertion where "The atomic string comes from an other thread!"

>> Source/WebCore/accessibility/AccessibilityObject.h:704
>> +    const String ariaKeyShortcutsValue() const;
> 
> should we remove aria as a prefix since this does AOM and aria

Ok

>> Source/WebCore/accessibility/AccessibilityObject.h:985
>> +    virtual const String ariaLiveRegionRelevant() const { return nullAtom(); }
> 
> ditto about these method names with aria

Ok
Comment 4 Nan Wang 2017-11-16 16:52:28 PST
Created attachment 327129 [details]
patch

Removed aria prefix
Comment 5 WebKit Commit Bot 2017-11-16 18:24:57 PST
Comment on attachment 327129 [details]
patch

Clearing flags on attachment: 327129

Committed r224953: <https://trac.webkit.org/changeset/224953>
Comment 6 WebKit Commit Bot 2017-11-16 18:24:59 PST
All reviewed patches have been landed.  Closing bug.