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

Unified Diff: chrome/browser/resources/downloads/focus_row.js

Issue 1281483008: Move downloads.FocusRow.shouldFocus to cr.ui.FocusRow.isFocusable (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@focus-row2
Patch Set: whoops Created 5 years, 4 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 | « no previous file | chrome/browser/resources/downloads/manager.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/downloads/focus_row.js
diff --git a/chrome/browser/resources/downloads/focus_row.js b/chrome/browser/resources/downloads/focus_row.js
index 250d1f7bbb001f51ad37919585fa3ccbbcecdfc7..5d7078ce727431e6d7a6ae29d93e6fdee5fd2c14 100644
--- a/chrome/browser/resources/downloads/focus_row.js
+++ b/chrome/browser/resources/downloads/focus_row.js
@@ -23,25 +23,6 @@ cr.define('downloads', function() {
focusRow.addFocusableElements_();
};
- /**
- * Determines if element should be focusable.
- * @param {Element} element
- * @return {boolean}
- */
- FocusRow.shouldFocus = function(element) {
- if (!element)
- return false;
-
- // Hidden elements are not focusable.
- var style = window.getComputedStyle(element);
- if (style.visibility == 'hidden' || style.display == 'none')
- return false;
-
- // Verify all ancestors are focusable.
- return !element.parentElement ||
- FocusRow.shouldFocus(element.parentElement);
- };
-
FocusRow.prototype = {
__proto__: cr.ui.FocusRow.prototype,
@@ -75,7 +56,7 @@ cr.define('downloads', function() {
var possiblyFocusableElements = this.querySelectorAll('[focus-type]');
for (var i = 0; i < possiblyFocusableElements.length; ++i) {
var possiblyFocusableElement = possiblyFocusableElements[i];
- if (FocusRow.shouldFocus(possiblyFocusableElement))
+ if (cr.ui.FocusRow.isFocusable(possiblyFocusableElement))
this.addFocusableElement(possiblyFocusableElement);
}
},
« no previous file with comments | « no previous file | chrome/browser/resources/downloads/manager.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698