From 7169b5a973686bac8812930eb9a77462e3069b6d Mon Sep 17 00:00:00 2001 From: "shreeram.k" Date: Wed, 24 Sep 2014 14:22:57 -0700 Subject: [PATCH] Adds conversion rule for WebAXRoleNone This is blink side patch for this CL https://codereview.chromium.org/588653003/ BUG=385070 Review URL: https://codereview.chromium.org/592683002 Cr-Commit-Position: refs/heads/master@{#296521} --- content/browser/accessibility/browser_accessibility_win.cc | 1 + .../browser/accessibility/dump_accessibility_tree_browsertest.cc | 4 ++++ content/renderer/accessibility/blink_ax_enum_conversion.cc | 2 ++ content/shell/renderer/test_runner/web_ax_object_proxy.cc | 2 ++ content/test/data/accessibility/aria-none-expected-android.txt | 2 ++ content/test/data/accessibility/aria-none-expected-mac.txt | 2 ++ content/test/data/accessibility/aria-none-expected-win.txt | 2 ++ content/test/data/accessibility/aria-none.html | 8 ++++++++ ui/accessibility/platform/ax_platform_node_mac.mm | 1 + 9 files changed, 24 insertions(+) create mode 100644 content/test/data/accessibility/aria-none-expected-android.txt create mode 100644 content/test/data/accessibility/aria-none-expected-mac.txt create mode 100644 content/test/data/accessibility/aria-none-expected-win.txt create mode 100644 content/test/data/accessibility/aria-none.html diff --git a/content/browser/accessibility/browser_accessibility_win.cc b/content/browser/accessibility/browser_accessibility_win.cc index 992ce1954fd6..ff239430f396 100644 --- a/content/browser/accessibility/browser_accessibility_win.cc +++ b/content/browser/accessibility/browser_accessibility_win.cc @@ -3773,6 +3773,7 @@ void BrowserAccessibilityWin::InitRoleAndState() { case ui::AX_ROLE_LOG: case ui::AX_ROLE_MARQUEE: case ui::AX_ROLE_MATTE: + case ui::AX_ROLE_NONE: case ui::AX_ROLE_PRESENTATIONAL: case ui::AX_ROLE_RULER_MARKER: case ui::AX_ROLE_SHEET: diff --git a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc index 01f65834acc0..621b7cc3b5f5 100644 --- a/content/browser/accessibility/dump_accessibility_tree_browsertest.cc +++ b/content/browser/accessibility/dump_accessibility_tree_browsertest.cc @@ -406,6 +406,10 @@ IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, RunTest(FILE_PATH_LITERAL("aria-orientation.html")); } +IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaNone) { + RunTest(FILE_PATH_LITERAL("aria-none.html")); +} + IN_PROC_BROWSER_TEST_F(DumpAccessibilityTreeTest, AccessibilityAriaPressed) { RunTest(FILE_PATH_LITERAL("aria-pressed.html")); diff --git a/content/renderer/accessibility/blink_ax_enum_conversion.cc b/content/renderer/accessibility/blink_ax_enum_conversion.cc index fc71b5ce3c4f..ffca006f4c9b 100644 --- a/content/renderer/accessibility/blink_ax_enum_conversion.cc +++ b/content/renderer/accessibility/blink_ax_enum_conversion.cc @@ -216,6 +216,8 @@ ui::AXRole AXRoleFromBlink(blink::WebAXRole role) { return ui::AX_ROLE_MENU_LIST_POPUP; case blink::WebAXRoleNavigation: return ui::AX_ROLE_NAVIGATION; + case blink::WebAXRoleNone: + return ui::AX_ROLE_NONE; case blink::WebAXRoleNote: return ui::AX_ROLE_NOTE; case blink::WebAXRoleOutline: diff --git a/content/shell/renderer/test_runner/web_ax_object_proxy.cc b/content/shell/renderer/test_runner/web_ax_object_proxy.cc index bb0c31a5077c..af70593ae51b 100644 --- a/content/shell/renderer/test_runner/web_ax_object_proxy.cc +++ b/content/shell/renderer/test_runner/web_ax_object_proxy.cc @@ -148,6 +148,8 @@ std::string RoleToString(blink::WebAXRole role) return result.append("Menu"); case blink::WebAXRoleNavigation: return result.append("Navigation"); + case blink::WebAXRoleNone: + return result.append("None"); case blink::WebAXRoleNote: return result.append("Note"); case blink::WebAXRoleOutline: diff --git a/content/test/data/accessibility/aria-none-expected-android.txt b/content/test/data/accessibility/aria-none-expected-android.txt new file mode 100644 index 000000000000..32b278a959ba --- /dev/null +++ b/content/test/data/accessibility/aria-none-expected-android.txt @@ -0,0 +1,2 @@ +android.webkit.WebView focusable focused scrollable name='With aria-role none' + android.view.View clickable name='With aria-role none' diff --git a/content/test/data/accessibility/aria-none-expected-mac.txt b/content/test/data/accessibility/aria-none-expected-mac.txt new file mode 100644 index 000000000000..eace51c3aebd --- /dev/null +++ b/content/test/data/accessibility/aria-none-expected-mac.txt @@ -0,0 +1,2 @@ +AXWebArea + AXStaticText AXValue='With aria-role none' diff --git a/content/test/data/accessibility/aria-none-expected-win.txt b/content/test/data/accessibility/aria-none-expected-win.txt new file mode 100644 index 000000000000..147108c419e5 --- /dev/null +++ b/content/test/data/accessibility/aria-none-expected-win.txt @@ -0,0 +1,2 @@ +ROLE_SYSTEM_DOCUMENT READONLY FOCUSABLE + ROLE_SYSTEM_STATICTEXT name='With aria-role none' diff --git a/content/test/data/accessibility/aria-none.html b/content/test/data/accessibility/aria-none.html new file mode 100644 index 000000000000..d7057543e3c0 --- /dev/null +++ b/content/test/data/accessibility/aria-none.html @@ -0,0 +1,8 @@ + + + + +

With aria-role none

+ + + diff --git a/ui/accessibility/platform/ax_platform_node_mac.mm b/ui/accessibility/platform/ax_platform_node_mac.mm index 5afd5d374656..28daf87efaa9 100644 --- a/ui/accessibility/platform/ax_platform_node_mac.mm +++ b/ui/accessibility/platform/ax_platform_node_mac.mm @@ -84,6 +84,7 @@ RoleMap BuildRoleMap() { {ui::AX_ROLE_MENU_LIST_OPTION, NSAccessibilityMenuItemRole}, {ui::AX_ROLE_MENU_LIST_POPUP, NSAccessibilityUnknownRole}, {ui::AX_ROLE_NAVIGATION, NSAccessibilityGroupRole}, + {ui::AX_ROLE_NONE, NSAccessibilityGroupRole}, {ui::AX_ROLE_NOTE, NSAccessibilityGroupRole}, {ui::AX_ROLE_OUTLINE, NSAccessibilityOutlineRole}, {ui::AX_ROLE_PARAGRAPH, NSAccessibilityGroupRole}, -- 2.11.4.GIT