summaryrefslogtreecommitdiffstats
path: root/content/browser/accessibility
diff options
context:
space:
mode:
authordmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 06:46:38 +0000
committerdmazzoni@chromium.org <dmazzoni@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-06-13 06:46:38 +0000
commitf1f845fcbcc0f73e33c7a6ef4f71f312f9af238b (patch)
tree7e34ba550f12d1389c48651d6f324b586a82d9f7 /content/browser/accessibility
parentebd0c8e3264eecb56c565ae9e84fedcf859b1c72 (diff)
downloadchromium_src-f1f845fcbcc0f73e33c7a6ef4f71f312f9af238b.zip
chromium_src-f1f845fcbcc0f73e33c7a6ef4f71f312f9af238b.tar.gz
chromium_src-f1f845fcbcc0f73e33c7a6ef4f71f312f9af238b.tar.bz2
Fix bug where NVDA wouldn't enter browse mode on page load.
This started happening when we started sending events on web pages before they fully load. BUG=368549 NOTRY=true Review URL: https://codereview.chromium.org/332893004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@276944 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'content/browser/accessibility')
-rw-r--r--content/browser/accessibility/browser_accessibility_manager_win.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc
index dfd1508..9aa5d4a 100644
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc
@@ -127,6 +127,15 @@ void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
if (node->GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX)
return;
+ // NVDA gets confused if we focus the main document element when it hasn't
+ // finished loading and it has no children at all, so suppress that event.
+ if (event_type == ui::AX_EVENT_FOCUS &&
+ node == GetRoot() &&
+ node->PlatformChildCount() == 0 &&
+ !node->GetBoolAttribute(ui::AX_ATTR_DOC_LOADED)) {
+ return;
+ }
+
LONG event_id = EVENT_MIN;
switch (event_type) {
case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED:
@@ -214,6 +223,10 @@ void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent(
// object and pass it that same id, which we can use to retrieve the
// IAccessible for this node.
LONG child_id = node->ToBrowserAccessibilityWin()->unique_id_win();
+
+ // Always send a focus before a load complete.
+ if (event_type == ui::AX_EVENT_LOAD_COMPLETE)
+ MaybeCallNotifyWinEvent(EVENT_OBJECT_FOCUS, child_id);
MaybeCallNotifyWinEvent(event_id, child_id);
}