Bug 171174

Summary: [ATK] Object attributes are missing for ARIA live region roles
Product: WebKit Reporter: Joanmarie Diggs <jdiggs>
Component: AccessibilityAssignee: Joanmarie Diggs <jdiggs>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, buildbot, cfleizach, commit-queue, dmazzoni, jcraig, samuel_white, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
none
Patch none

Description Joanmarie Diggs 2017-04-22 16:10:13 PDT
https://rawgit.com/w3c/aria/master/core-aam/core-aam.html#role-map-status

ROLE_STATUSBAR + object attributes container-live:polite;live:polite;container-live-role:status
Comment 1 Radar WebKit Bug Importer 2017-04-22 16:11:29 PDT
<rdar://problem/31775582>
Comment 2 Joanmarie Diggs 2017-09-21 15:34:48 PDT
Created attachment 321486 [details]
Patch
Comment 3 Joanmarie Diggs 2017-09-21 15:38:19 PDT
As indicated in the updated summary/title: Turns out we're not exposing any live region attributes to ATK. Attached patch solves that. I'll tackle the missing events in a subsequent bug.
Comment 4 chris fleizach 2017-09-21 18:23:00 PDT
Comment on attachment 321486 [details]
Patch

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

> Source/WebCore/accessibility/AccessibilityObject.cpp:2510
> +    return const_cast<AccessibilityObject*>(AccessibilityObject::matchedParent(*this, false, [] (const AccessibilityObject& object) {

what if ariaLiveRegionAncestor also considered "this". then we can probably write

bool AccessibilityObject::isInsideARIALiveRegion() const {
return ariaLiveRegionAncestor()
}

and it looks like some of your GTK code could be combined instead of having separating paths for ancestor and this aria live region status
Comment 5 Joanmarie Diggs 2017-09-22 09:05:43 PDT
Created attachment 321553 [details]
Patch
Comment 6 Joanmarie Diggs 2017-09-22 09:23:31 PDT
> what if ariaLiveRegionAncestor also considered "this". then we can probably
> write
> 
> bool AccessibilityObject::isInsideARIALiveRegion() const {
> return ariaLiveRegionAncestor()
> }

Done.
 
> and it looks like some of your GTK code could be combined instead of having
> separating paths for ancestor and this aria live region status

Sorta done. Sadly, the current mappings are less than ideal (and pre-date my involvement), but they are what's in the Core AAM. And they specify exposure in slightly different ways depending on whether the element is the live region or a descendant of the live region. Anyway, I tried to combine things, and where the separate paths were still needed, I added comments to hopefully makes it clear why.

Related to the above changes: In the original patch, I was actually using the value returned by ariaLiveRegionStatus() deliberately, because on my platform, even disabled/off live regions need to be treated as live regions as far as mapping/exposure of properties is concerned. WebCore only treats elements as supporting live regions if they are enabled/{polite,assertive}. So using ariaLiveRegionAncestor() for the current element rather than the status requires it (be able to) treat disabled/off live regions as live regions. I assume what's in WebCore now was done for your platform's needs, so I added the optional argument excludeIfOff defaulting to true to not change existing behavior. If I'm wrong about my assumptions, please let me know.

Thanks again!
Comment 7 Joanmarie Diggs 2017-09-22 12:50:04 PDT
Created attachment 321582 [details]
Patch
Comment 8 Joanmarie Diggs 2017-09-23 08:05:33 PDT
Created attachment 321633 [details]
Patch
Comment 9 WebKit Commit Bot 2017-09-24 04:52:40 PDT
Comment on attachment 321633 [details]
Patch

Clearing flags on attachment: 321633

Committed r222433: <http://trac.webkit.org/changeset/222433>
Comment 10 WebKit Commit Bot 2017-09-24 04:52:42 PDT
All reviewed patches have been landed.  Closing bug.