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); |
} |
}, |