Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(234)

Unified Diff: chrome/renderer/resources/extensions/automation_custom_bindings.js

Issue 2575233002: Always retarget blur events to the root of the focused node (Closed)
Patch Set: Fix test. Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698