Bug 117706

Summary: AX: display: -webkit-box formatted <li> elements are not assigned correct accessibility roles
Product: WebKit Reporter: Brent Fulgham <bfulgham>
Component: AccessibilityAssignee: Brent Fulgham <bfulgham>
Status: RESOLVED FIXED    
Severity: Normal CC: aboxhall, apinheiro, bfulgham, cdumez, cfleizach, commit-queue, dmazzoni, gyuyoung.kim, jdiggs, mario, rakuco, roger_fong
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
This patch includes some unintended changes. Do not bother reviewing.
none
Patch cfleizach: review+

Description Brent Fulgham 2013-06-17 09:58:45 PDT
The logic that determines accessibility roles for different HTML tokens does the wrong thing for <li> elements that have been given the "-webkit-box" display style.

List items should be assigned the "ListItemRole" Web Role, but are instead given a "GroupingRole".
Comment 1 Brent Fulgham 2013-06-17 11:00:08 PDT
<rdar://problem/9524530>
Comment 2 Brent Fulgham 2013-06-17 11:07:00 PDT
Created attachment 204840 [details]
This patch includes some unintended changes.  Do not bother reviewing.
Comment 3 Brent Fulgham 2013-06-17 11:18:27 PDT
Created attachment 204842 [details]
Patch
Comment 4 chris fleizach 2013-06-17 11:21:02 PDT
Comment on attachment 204842 [details]
Patch

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

looking good. i would suggest updating the layout test to make it more specific.

> LayoutTests/accessibility/box-styled-lists.html:46
> +            var bodyElement = document.getElementById("body");

I try to avoid the attributesofChildren() method these days because it's not very specific if something breaks.

For this test I would probably do

var listItem = document.accessibleElementById("test 1");
shouldBe("listeItem.role", "'AXRole: AX...'");
Comment 5 Brent Fulgham 2013-06-17 11:24:29 PDT
(In reply to comment #4)
> (From update of attachment 204842 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=204842&action=review
> 
> var listItem = document.accessibleElementById("test 1");
> shouldBe("listeItem.role", "'AXRole: AX...'");

I looked at using this, but I'd have to have a custom test for mac and one for windows, since it would be:

Mac:
shouldBe("listItem.role", "'AXRole: AX...'"); 

Win:
shouldBe("listItem.role", "'list item'");

and so forth.

But I'll definitely change the "attributesOfChildren()" call to "accessibleElementById()".
Comment 6 chris fleizach 2013-06-17 11:25:50 PDT
Comment on attachment 204842 [details]
Patch

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

>> LayoutTests/accessibility/box-styled-lists.html:46
>> +            var bodyElement = document.getElementById("body");
> 
> I try to avoid the attributesofChildren() method these days because it's not very specific if something breaks.
> 
> For this test I would probably do
> 
> var listItem = document.accessibleElementById("test 1");
> shouldBe("listeItem.role", "'AXRole: AX...'");

I've also done

debug("List item role: " + listItem.role)

so that you can just use different expectations
Comment 7 Brent Fulgham 2013-06-17 18:37:16 PDT
Committed r151665: <http://trac.webkit.org/changeset/151665>