summaryrefslogtreecommitdiffstats
path: root/content/browser/accessibility/browser_accessibility_manager.cc
diff options
context:
space:
mode:
authordtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-20 01:55:32 +0000
committerdtseng@chromium.org <dtseng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-12-20 01:55:32 +0000
commit05769e3c62f9371a8aef06c810ac6767b410241d (patch)
treef038fcb9ce7472dc2ef95f4ac309c988b05b5302 /content/browser/accessibility/browser_accessibility_manager.cc
parent85630ddb424cf3e826e0aa11b20fa2c24ed8633a (diff)
downloadchromium_src-05769e3c62f9371a8aef06c810ac6767b410241d.zip
chromium_src-05769e3c62f9371a8aef06c810ac6767b410241d.tar.gz
chromium_src-05769e3c62f9371a8aef06c810ac6767b410241d.tar.bz2
Fixes regression in checkbox state for NVDA.
Rearranges the logic to properly initialize the manager's child id and renderer id maps after pre-initializing but before initializing children. Also, ensures that the focused item gets set before initializing children. Since we use |focus_| in BrowserAccessibilityManager as a test whether |instance| is focused, we need to call SetFocus() before initializing children. BUG=83396 TEST=manual. Review URL: http://codereview.chromium.org/8994008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@115067 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/accessibility/browser_accessibility_manager.cc')
-rw-r--r--content/browser/accessibility/browser_accessibility_manager.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/content/browser/accessibility/browser_accessibility_manager.cc b/content/browser/accessibility/browser_accessibility_manager.cc
index 266095a..91cc0785 100644
--- a/content/browser/accessibility/browser_accessibility_manager.cc
+++ b/content/browser/accessibility/browser_accessibility_manager.cc
@@ -338,21 +338,21 @@ BrowserAccessibility* BrowserAccessibilityManager::CreateAccessibilityTree(
}
instance->PreInitialize(this, parent, child_id, index_in_parent, src);
+ child_id_map_[child_id] = instance;
+ renderer_id_to_child_id_map_[src.id] = child_id;
+
+ if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1)
+ SetFocus(instance, false);
+
for (int i = 0; i < static_cast<int>(src.children.size()); ++i) {
BrowserAccessibility* child = CreateAccessibilityTree(
instance, src.children[i], i, children_can_send_show_events);
instance->AddChild(child);
}
- child_id_map_[child_id] = instance;
- renderer_id_to_child_id_map_[src.id] = child_id;
-
if (src.role == WebAccessibility::ROLE_ROOT_WEB_AREA)
root_ = instance;
- if ((src.state >> WebAccessibility::STATE_FOCUSED) & 1)
- SetFocus(instance, false);
-
// Note: the purpose of send_show_events and children_can_send_show_events
// is so that we send a single OBJECT_SHOW event for the root of a subtree
// that just appeared for the first time, but not on any descendant of