Bug 125857 - [ATK] Expose accessibility objects for <dl>, <dt> and <dd>
Summary: [ATK] Expose accessibility objects for <dl>, <dt> and <dd>
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks: 125493
  Show dependency treegraph
 
Reported: 2013-12-17 08:04 PST by Mario Sanchez Prada
Modified: 2014-01-07 07:16 PST (History)
9 users (show)

See Also:


Attachments
Patch proposal (11.04 KB, patch)
2013-12-17 08:12 PST, Mario Sanchez Prada
cfleizach: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Sanchez Prada 2013-12-17 08:04:18 PST
Now that ATK 2.11.4 has been released, we have the proper roles to map these elements:

 * <div role="dl"> shows up as ATK_ROLE_LIST, should be ATK_ROLE_DESCRIPTION_LIST
 * <div role="dt"> shows up as ATK_ROLE_UNKNOWN, should be ATK_ROLE_DESCRIPTION_TERM
 * <div role="dd"> shows up as ATK_ROLE_UNKNOWN, should be ATK_ROLE_DESCRIPTION_VALUE

[1] https://mail.gnome.org/archives/gnome-announce-list/2013-December/msg00007.html
Comment 1 Mario Sanchez Prada 2013-12-17 08:12:15 PST
Created attachment 219420 [details]
Patch proposal
Comment 2 chris fleizach 2013-12-17 09:02:18 PST
Comment on attachment 219420 [details]
Patch proposal

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

> Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp:638
> +        if (coreObject->isList() && toAccessibilityList(coreObject)->isDescriptionList())

It might be better to introduce a new WebCore role for DescriptionList, but I don't feel that strongly about it
Comment 3 Mario Sanchez Prada 2013-12-17 09:49:34 PST
(In reply to comment #2)
> (From update of attachment 219420 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=219420&action=review
> 
> > Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp:638
> > +        if (coreObject->isList() && toAccessibilityList(coreObject)->isDescriptionList())
> 
> It might be better to introduce a new WebCore role for DescriptionList, but I don't feel that strongly about it

There is a DescriptionListRole already, which in theory should get assigned to any object with the <dl> tag name in determineAccessibilityRole(). Problem is that there is a hardcoded rule in AXObjectCache::createFromRenderer() that creates an instance of AccessibilityList for those elements too:

static PassRefPtr<AccessibilityObject> createFromRenderer(RenderObject* renderer)
{
    // FIXME: How could renderer->node() ever not be an Element?
    Node* node = renderer->node();

    // If the node is aria role="list" or the aria role is empty and its a
    // ul/ol/dl type (it shouldn't be a list if aria says otherwise).
    if (node && ((nodeHasRole(node, "list") || nodeHasRole(node, "directory"))
                      || (nodeHasRole(node, nullAtom) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
        return AccessibilityList::create(renderer);
   [...]
}

I thought of updating Accessibility::roleValue() to do this isDescriptionList() check and return ListRole or DescriptionListRole accordingly, but I discarded because I was not sure about which things that might break in the Mac, and also because I saw in the Mac wrapper that DescriptionListRole is used in the Mac as a subrole, not a main role, so I was not sure at all about removing the ListRole thing from there.

So, in the end, I went for doing that check in the ATK wrapper, but I'm open to reconsider other options if you think they're feasible.
Comment 4 Mario Sanchez Prada 2013-12-17 10:05:31 PST
Committed r160712: <http://trac.webkit.org/changeset/160712>
Comment 5 Mario Sanchez Prada 2013-12-17 10:06:40 PST
(In reply to comment #4)
> Committed r160712: <http://trac.webkit.org/changeset/160712>

I pushed this patch now, but I'm still open to discuss about the DescriptionListRole thing, my previous comment still applies. Just saying :)
Comment 6 chris fleizach 2013-12-17 10:08:27 PST
(In reply to comment #3)
> (In reply to comment #2)
> > (From update of attachment 219420 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=219420&action=review
> > 
> > > Source/WebCore/accessibility/atk/WebKitAccessibleWrapperAtk.cpp:638
> > > +        if (coreObject->isList() && toAccessibilityList(coreObject)->isDescriptionList())
> > 
> > It might be better to introduce a new WebCore role for DescriptionList, but I don't feel that strongly about it
> 
> There is a DescriptionListRole already, which in theory should get assigned to any object with the <dl> tag name in determineAccessibilityRole(). Problem is that there is a hardcoded rule in AXObjectCache::createFromRenderer() that creates an instance of AccessibilityList for those elements too:
> 
> static PassRefPtr<AccessibilityObject> createFromRenderer(RenderObject* renderer)
> {
>     // FIXME: How could renderer->node() ever not be an Element?
>     Node* node = renderer->node();
> 
>     // If the node is aria role="list" or the aria role is empty and its a
>     // ul/ol/dl type (it shouldn't be a list if aria says otherwise).
>     if (node && ((nodeHasRole(node, "list") || nodeHasRole(node, "directory"))
>                       || (nodeHasRole(node, nullAtom) && (node->hasTagName(ulTag) || node->hasTagName(olTag) || node->hasTagName(dlTag)))))
>         return AccessibilityList::create(renderer);
>    [...]
> }
> 
> I thought of updating Accessibility::roleValue() to do this isDescriptionList() check and return ListRole or DescriptionListRole accordingly, but I discarded because I was not sure about which things that might break in the Mac, and also because I saw in the Mac wrapper that DescriptionListRole is used in the Mac as a subrole, not a main role, so I was not sure at all about removing the ListRole thing from there.
> 
> So, in the end, I went for doing that check in the ATK wrapper, but I'm open to reconsider other options if you think they're feasible.

I think we should go for that route. we may need to update some Mac things but I don't foresee any blockers in that case
Comment 7 Mario Sanchez Prada 2014-01-07 07:16:26 PST
(In reply to comment #6)
> > I thought of updating Accessibility::roleValue() to do this 
> > isDescriptionList() check and return ListRole or DescriptionListRole 
> > accordingly, but I discarded because I was not sure about which things that 
> > might break in the Mac, and also because I saw in the Mac wrapper that 
> > DescriptionListRole is used in the Mac as a subrole, not a main role, so I 
> > was not sure at all about removing the ListRole thing from there.
> > 
> > So, in the end, I went for doing that check in the ATK wrapper, but I'm open 
> > to reconsider other options if you think they're feasible.
> 
> I think we should go for that route. we may need to update some Mac things but 
> I don't foresee any blockers in that case

See https://bugs.webkit.org/show_bug.cgi?id=126579#c2
Comment 8 Radar WebKit Bug Importer 2014-01-07 07:16:53 PST
<rdar://problem/15762151>