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.
Created attachment 161067 [details] Patch
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 on attachment 161067 [details] Patch WebKit API change LGTM.
Created attachment 161076 [details] Patch Update tests. Moved accessibility/canvas.html to platform/mac since it tests for a Mac-specific role.
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 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 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
Created attachment 161151 [details] Patch for landing
Comment on attachment 161151 [details] Patch for landing Clearing flags on attachment: 161151 Committed r126972: <http://trac.webkit.org/changeset/126972>
All reviewed patches have been landed. Closing bug.
Re-opened since this is blocked by 95349
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.
Created attachment 161273 [details] Patch for landing
Comment on attachment 161273 [details] Patch for landing Clearing flags on attachment: 161273 Committed r127084: <http://trac.webkit.org/changeset/127084>
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?
(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