Bug 95248 - AX: Canvas should have a distinct role
Summary: AX: Canvas should have a distinct role
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Dominic Mazzoni
URL:
Keywords:
Depends on: 95349
Blocks:
  Show dependency treegraph
 
Reported: 2012-08-28 14:43 PDT by Dominic Mazzoni
Modified: 2012-09-04 11:24 PDT (History)
10 users (show)

See Also:


Attachments
Patch (18.74 KB, patch)
2012-08-28 15:02 PDT, Dominic Mazzoni
no flags Details | Formatted Diff | Diff
Patch (24.22 KB, patch)
2012-08-28 15:53 PDT, Dominic Mazzoni
no flags Details | Formatted Diff | Diff
Patch for landing (24.18 KB, patch)
2012-08-29 00:07 PDT, Dominic Mazzoni
no flags Details | Formatted Diff | Diff
Patch for landing (24.19 KB, patch)
2012-08-29 11:25 PDT, Dominic Mazzoni
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dominic Mazzoni 2012-08-28 14:43:03 PDT
On many platforms, the role of "image" or "graphic" is not allowed to have children, so we should use a special role for canvas inside WebCore and let each platform decide on the appropriate role to use, taking into account if the canvas has fallback content.
Comment 1 Dominic Mazzoni 2012-08-28 15:02:55 PDT
Created attachment 161067 [details]
Patch
Comment 2 WebKit Review Bot 2012-08-28 15:05:16 PDT
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
Comment 3 Adam Barth 2012-08-28 15:50:16 PDT
Comment on attachment 161067 [details]
Patch

WebKit API change LGTM.
Comment 4 Dominic Mazzoni 2012-08-28 15:53:33 PDT
Created attachment 161076 [details]
Patch

Update tests. Moved accessibility/canvas.html to platform/mac since it tests for a Mac-specific role.
Comment 5 chris fleizach 2012-08-28 16:43:30 PDT
Comment on attachment 161076 [details]
Patch

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

> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1994
> +            return false;

i don't think we want to ignore the canvas element when it has fallback content. I think we just want to make it a "group" role. we should still be able to gather info from it like an aria-label for example
Comment 6 Dominic Mazzoni 2012-08-28 17:09:38 PDT
Comment on attachment 161076 [details]
Patch

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

>> Source/WebCore/accessibility/AccessibilityRenderObject.cpp:1994
>> +            return false;
> 
> i don't think we want to ignore the canvas element when it has fallback content. I think we just want to make it a "group" role. we should still be able to gather info from it like an aria-label for example

This is in accessibilityIsIgnored, so false means "don't ignore". If it has fallback content, we'll always include it and we'll make it a group role,

If it does not have any fallback content, we'll ignore it if its size is 1x1, or if it has no title, description, or help.
Comment 7 chris fleizach 2012-08-28 22:35:17 PDT
Comment on attachment 161076 [details]
Patch

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

just one question inline. otherwise looks good

> Source/WebCore/accessibility/AccessibilityNodeObject.cpp:318
> +    Element* element = toElement(node);

it doesn't appear that you need to case to Element in this case
Comment 8 Dominic Mazzoni 2012-08-29 00:07:18 PDT
Created attachment 161151 [details]
Patch for landing
Comment 9 WebKit Review Bot 2012-08-29 01:05:02 PDT
Comment on attachment 161151 [details]
Patch for landing

Clearing flags on attachment: 161151

Committed r126972: <http://trac.webkit.org/changeset/126972>
Comment 10 WebKit Review Bot 2012-08-29 01:05:07 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 WebKit Review Bot 2012-08-29 08:56:49 PDT
Re-opened since this is blocked by 95349
Comment 12 Julien Chaffraix 2012-08-29 09:03:14 PDT
Link to the test failures:

http://test-results.appspot.com/dashboards/flakiness_dashboard.html#tests=accessibility%2Fcanvas-description-and-role.html

http://build.webkit.org/results/Apple%20Lion%20Debug%20WK1%20%28Tests%29/r127000%20%282336%29/results.html

The failure is the same in both cases:

-PASS axContainer.childrenCount is 2
+FAIL axContainer.childrenCount should be 2. Was 4.
Comment 13 Dominic Mazzoni 2012-08-29 11:25:21 PDT
Created attachment 161273 [details]
Patch for landing
Comment 14 WebKit Review Bot 2012-08-29 19:14:21 PDT
Comment on attachment 161273 [details]
Patch for landing

Clearing flags on attachment: 161273

Committed r127084: <http://trac.webkit.org/changeset/127084>
Comment 15 WebKit Review Bot 2012-08-29 19:14:26 PDT
All reviewed patches have been landed.  Closing bug.
Comment 16 Joanmarie Diggs (irc: joanie) 2012-09-01 06:51:00 PDT
Dominic, since we have a test without results for Gtk, I was looking at the test. Was there a reason you mapped the new CanvasRole to ATK_ROLE_IMAGE in the Gtk platform instead of ATK_ROLE_CANVAS?
Comment 17 Dominic Mazzoni 2012-09-04 11:24:31 PDT
(In reply to comment #16)
> Dominic, since we have a test without results for Gtk, I was looking at the test. Was there a reason you mapped the new CanvasRole to ATK_ROLE_IMAGE in the Gtk platform instead of ATK_ROLE_CANVAS?

See comment on https://bugs.webkit.org/show_bug.cgi?id=95644