Commit 09032f2c authored by dmazzoni@chromium.org's avatar dmazzoni@chromium.org

Quick fix for problems with editable text field accessibility by not sending

children of text fields from the renderer to the browser. The child containing
the text appeared to be redundant anyway.

BUG=none
TEST=updated unit test, manual testing with screen readers

Review URL: http://codereview.chromium.org/6469038

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@75416 0039d316-1c4b-4281-b951-d872f2087c98
parent d566da07
...@@ -563,12 +563,10 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest, ...@@ -563,12 +563,10 @@ IN_PROC_BROWSER_TEST_F(AccessibilityWinBrowserTest,
NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED); NotificationType::RENDER_VIEW_HOST_ACCESSIBILITY_TREE_UPDATED);
// Check the browser's copy of the renderer accessibility tree. // Check the browser's copy of the renderer accessibility tree.
AccessibleChecker text_field_div_checker(L"", L"div", L"");
AccessibleChecker text_field_checker(L"", ROLE_SYSTEM_TEXT, L"old value"); AccessibleChecker text_field_checker(L"", ROLE_SYSTEM_TEXT, L"old value");
text_field_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE); text_field_checker.SetExpectedState(STATE_SYSTEM_FOCUSABLE);
AccessibleChecker body_checker(L"", L"body", L""); AccessibleChecker body_checker(L"", L"body", L"");
AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L""); AccessibleChecker document_checker(L"", ROLE_SYSTEM_DOCUMENT, L"");
text_field_checker.AppendExpectedChild(&text_field_div_checker);
body_checker.AppendExpectedChild(&text_field_checker); body_checker.AppendExpectedChild(&text_field_checker);
document_checker.AppendExpectedChild(&body_checker); document_checker.AppendExpectedChild(&body_checker);
document_checker.CheckAccessible(GetRendererAccessible()); document_checker.CheckAccessible(GetRendererAccessible());
......
...@@ -380,6 +380,12 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src, ...@@ -380,6 +380,12 @@ void WebAccessibility::Init(const WebKit::WebAccessibilityObject& src,
// Add the source object to the cache and store its id. // Add the source object to the cache and store its id.
id = cache->addOrGetId(src); id = cache->addOrGetId(src);
if (role == WebAccessibility::ROLE_EDITABLE_TEXT ||
role == WebAccessibility::ROLE_TEXTAREA ||
role == WebAccessibility::ROLE_TEXT_FIELD) {
include_children = false;
}
if (include_children) { if (include_children) {
// Recursively create children. // Recursively create children.
int child_count = src.childCount(); int child_count = src.childCount();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment