Index: content/browser/accessibility/browser_accessibility_manager_win.cc |
diff --git a/content/browser/accessibility/browser_accessibility_manager_win.cc b/content/browser/accessibility/browser_accessibility_manager_win.cc |
index eb9a2e4db2101e7eec5e037241d0f0230fbb19f2..57beb91e694c9d47070bec05cfe258a1eadd4fa3 100644 |
--- a/content/browser/accessibility/browser_accessibility_manager_win.cc |
+++ b/content/browser/accessibility/browser_accessibility_manager_win.cc |
@@ -137,6 +137,9 @@ void BrowserAccessibilityManagerWin::UserIsReloading() { |
void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( |
ui::AXEvent event_type, |
BrowserAccessibility* node) { |
+ if (!node) |
+ return; |
+ |
BrowserAccessibilityDelegate* root_delegate = GetDelegateFromRootManager(); |
if (!root_delegate || !root_delegate->AccessibilityGetAcceleratedWidget()) { |
DLOG(WARNING) << "Not firing AX event because of no root_delegate or hwnd"; |
@@ -165,9 +168,13 @@ void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( |
LONG event_id = EVENT_MIN; |
switch (event_type) { |
- case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: |
+ case ui::AX_EVENT_ACTIVEDESCENDANTCHANGED: { |
event_id = IA2_EVENT_ACTIVE_DESCENDANT_CHANGED; |
+ BrowserAccessibility* active_descendant = GetActiveDescendantFocus(node); |
+ if (active_descendant != node) |
+ FireFocusEvent(active_descendant); |
break; |
+ } |
case ui::AX_EVENT_ALERT: |
event_id = EVENT_SYSTEM_ALERT; |
break; |
@@ -217,9 +224,6 @@ void BrowserAccessibilityManagerWin::NotifyAccessibilityEvent( |
break; |
} |
- if (!node) |
- return; |
- |
if (event_id != EVENT_MIN) |
MaybeCallNotifyWinEvent(event_id, node); |
@@ -246,6 +250,7 @@ bool BrowserAccessibilityManagerWin::CanFireEvents() { |
void BrowserAccessibilityManagerWin::FireFocusEvent( |
BrowserAccessibility* node) { |
+ DCHECK(node); |
// On Windows, we always fire a FOCUS event on the root of a frame before |
// firing a focus event within that frame. |
if (node->manager() != last_focused_manager_ && |