Index: chrome/renderer/resources/extensions/automation_custom_bindings.js |
diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js |
index 15415a91e00f423eb542c708503f5ea4f2e6dc0e..92ef4cb902a3850faf4e1eedca5ef6c11d3904ad 100644 |
--- a/chrome/renderer/resources/extensions/automation_custom_bindings.js |
+++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js |
@@ -93,6 +93,14 @@ automationUtil.updateFocusedNode = function() { |
automationUtil.focusedNode = automationUtil.getFocus(); |
}; |
+/** |
+ * Updates the focus on blur. |
+ */ |
+automationUtil.updateFocusedNodeOnBlur = function() { |
+ var focus = automationUtil.getFocus(); |
+ automationUtil.focusedNode = focus ? focus.root : null; |
+}; |
+ |
automation.registerCustomHook(function(bindingsAPI) { |
var apiFunctions = bindingsAPI.apiFunctions; |
@@ -287,7 +295,7 @@ automationInternal.onAccessibilityEvent.addListener(function(eventParams) { |
// events but otherwise not handle blur events specially. |
var node = privates(targetTree).impl.get(eventParams.targetID); |
if (node == node.root) |
- isFocusEvent = true; |
+ automationUtil.updateFocusedNodeOnBlur(); |
} else if (eventParams.eventType == schema.EventType.mediaStartedPlaying || |
eventParams.eventType == schema.EventType.mediaStoppedPlaying) { |
// These events are global to the tree. |