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

Unified Diff: ui/webui/resources/js/cr/ui/focus_manager.js

Issue 905433003: webui: remove FocusManager.disableMouseFocusOnButtons(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months 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 | « chrome/browser/resources/uber/uber_frame.js ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/webui/resources/js/cr/ui/focus_manager.js
diff --git a/ui/webui/resources/js/cr/ui/focus_manager.js b/ui/webui/resources/js/cr/ui/focus_manager.js
index 3d2fac9020bac4467bbf4e9814bd34582cad3d63..2142efd2ee75392600a4e7ec4df512c880390c55 100644
--- a/ui/webui/resources/js/cr/ui/focus_manager.js
+++ b/ui/webui/resources/js/cr/ui/focus_manager.js
@@ -194,38 +194,6 @@ cr.define('cr.ui', function() {
},
};
- /**
- * Disable mouse-focus for button controls.
- * Button form controls are mouse-focusable since Chromium 30. We want the
- * old behavior in some WebUI pages.
- */
- FocusManager.disableMouseFocusOnButtons = function() {
- document.addEventListener('mousedown', function(event) {
- if (event.defaultPrevented)
- return;
- var node = event.target;
- var tagName = node.tagName;
- if (tagName != 'BUTTON' && tagName != 'INPUT') {
- do {
- node = node.parentNode;
- if (!node || node.nodeType != Node.ELEMENT_NODE)
- return;
- } while (node.tagName != 'BUTTON');
- }
- var type = node.type;
- if (type == 'button' || type == 'reset' || type == 'submit' ||
- type == 'radio' || type == 'checkbox') {
- if (document.activeElement != node)
- document.activeElement.blur();
-
- // Focus the current window so that if the active element is in another
- // window, it is deactivated.
- window.focus();
- event.preventDefault();
- }
- }, false);
- };
-
return {
FocusManager: FocusManager,
};
« no previous file with comments | « chrome/browser/resources/uber/uber_frame.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698