summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordbeam <dbeam@chromium.org>2015-08-12 10:13:15 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-12 17:13:59 +0000
commit768c8b6cbb16201b1828c73fa868b141e7b114c6 (patch)
treed37d74d2df3133eb730b20981d8a9c365244dd72
parente892683fcd3c1c00357f7587fb650cbb51d9c0df (diff)
downloadchromium_src-768c8b6cbb16201b1828c73fa868b141e7b114c6.zip
chromium_src-768c8b6cbb16201b1828c73fa868b141e7b114c6.tar.gz
chromium_src-768c8b6cbb16201b1828c73fa868b141e7b114c6.tar.bz2
Fix downloads focus bug when pressing Enter on "Pause"
This probably affects other types of things where "clicking" the control hides it (e.g. "Resume") R=dmazzoni@chromium.org BUG=519129 Review URL: https://codereview.chromium.org/1284843003 Cr-Commit-Position: refs/heads/master@{#343035}
-rw-r--r--chrome/browser/resources/downloads/focus_row.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/chrome/browser/resources/downloads/focus_row.js b/chrome/browser/resources/downloads/focus_row.js
index 5d7078c..c840132 100644
--- a/chrome/browser/resources/downloads/focus_row.js
+++ b/chrome/browser/resources/downloads/focus_row.js
@@ -26,14 +26,22 @@ cr.define('downloads', function() {
FocusRow.prototype = {
__proto__: cr.ui.FocusRow.prototype,
- /** @override */
+ /**
+ * TODO(dbeam): remove all this :not([hidden]) hackery and just create 2 new
+ * methods on cr.ui.FocusRow that get possibly focusable nodes as well as
+ * currently focusable nodes (taking into account visibility).
+ * @override
+ */
getEquivalentElement: function(element) {
- if (this.focusableElements.indexOf(element) > -1)
+ if (this.focusableElements.indexOf(element) > -1 &&
+ cr.ui.FocusRow.isFocusable(element)) {
return assert(element);
+ }
// All elements default to another element with the same type.
var columnType = element.getAttribute('focus-type');
- var equivalent = this.querySelector('[focus-type=' + columnType + ']');
+ var equivalent = this.querySelector(
+ '[focus-type=' + columnType + ']:not([hidden])');
if (this.focusableElements.indexOf(equivalent) < 0) {
equivalent = null;