Bug 137867 - AX: [ATK] Do not return ATK_ROLE_UNKNOWN for null or otherwise invalid accessible objects
Summary: AX: [ATK] Do not return ATK_ROLE_UNKNOWN for null or otherwise invalid access...
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All Linux
: P2 Normal
Assignee: Joanmarie Diggs
Keywords: InRadar
Depends on:
Reported: 2014-10-19 15:11 PDT by Joanmarie Diggs
Modified: 2014-11-13 14:11 PST (History)
9 users (show)

See Also:

Patch (2.11 KB, patch)
2014-10-19 15:15 PDT, Joanmarie Diggs
no flags Details | Formatted Diff | Diff
Patch (6.85 KB, patch)
2014-11-13 12:41 PST, Joanmarie Diggs
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Joanmarie Diggs 2014-10-19 15:11:18 PDT
Currently in webkitAccessibleGetRole() we have:

    g_return_val_if_fail(WEBKIT_IS_ACCESSIBLE(object), ATK_ROLE_UNKNOWN);
    returnValIfWebKitAccessibleIsInvalid(WEBKIT_ACCESSIBLE(object), ATK_ROLE_UNKNOWN);


    if (!coreObject)
        return ATK_ROLE_UNKNOWN;

ATK_ROLE_UNKNOWN suggests that there is a valid accessible object but the platform role mapping for that object is unknown. It is an indication of a WebKit bug (there should be a valid mapping). But it is also an indication to assistive technologies that there might be some obtainable useful information associated with this mystery object. As such assitive technologies might choose to poke at the object further. In contrast, if the object is null or otherwise invalid, there is arguably no obtainable useful information and thus ATs should not bother trying. We can distinguish these two conditions by exposing the latter as ATK_ROLE_INVALID.
Comment 1 Joanmarie Diggs 2014-10-19 15:15:33 PDT
Created attachment 240090 [details]
Comment 2 Joanmarie Diggs 2014-10-19 15:17:55 PDT
(In reply to comment #1)
> Created attachment 240090 [details]
> Patch

This is a WIP (hence not asking for review yet). Fixing the bug is simple enough; coming up with a test case is harder because we shouldn't be exposing accessible objects that have ROLE_UNKNOWN or ROLE_INVALID to assistive technologies in the first place. But I haven't given up quite yet. :)
Comment 3 Radar WebKit Bug Importer 2014-10-27 11:03:21 PDT
Comment 4 Joanmarie Diggs 2014-11-13 12:41:51 PST
Created attachment 241496 [details]
Comment 5 Joanmarie Diggs 2014-11-13 13:14:25 PST
Mario or Chris: The patch is trivial. And there is a test now. (I had forgotten about detached objects as a valid and easy means to test this.) So if either of you has time for a quick review, that would be awesome. Thanks!
Comment 6 Joanmarie Diggs 2014-11-13 13:30:21 PST
Comment on attachment 241496 [details]

Thanks Chris!
Comment 7 WebKit Commit Bot 2014-11-13 14:11:40 PST
Comment on attachment 241496 [details]

Clearing flags on attachment: 241496

Committed r176091: <http://trac.webkit.org/changeset/176091>
Comment 8 WebKit Commit Bot 2014-11-13 14:11:48 PST
All reviewed patches have been landed.  Closing bug.