From e2f3b54ba488d5fac6f4f3d2d75b46dada19660a Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Sun, 8 Jan 2012 23:04:24 +0800 Subject: Make focusInput consider only visible input elements. --- vimiumFrontend.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/vimiumFrontend.js b/vimiumFrontend.js index c5df6372..5baffa47 100644 --- a/vimiumFrontend.js +++ b/vimiumFrontend.js @@ -231,12 +231,16 @@ function focusInput(count) { var i = 0; while (i < count) { - i += 1; - var currentInputBox = results.iterateNext(); if (!currentInputBox) { break; } + var clientRect = currentInputBox.getClientRects()[0]; + if (!linkHints.isVisible(currentInputBox, clientRect)) + continue; + lastInputBox = currentInputBox; + + i += 1; } if (lastInputBox) { lastInputBox.focus(); } -- cgit v1.2.3