From 699b487ab25b64f9fb93fb05dc9a003a2b4ae32f Mon Sep 17 00:00:00 2001 From: Kris Maglione Date: Sun, 17 Oct 2010 17:18:00 -0400 Subject: [PATCH] Try harder not to count invisible elements in gi. --- common/content/buffer.js | 3 ++- common/content/commands.js | 2 ++ common/locale/en-US/repeat.xml | 4 ++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common/content/buffer.js b/common/content/buffer.js index 758c6065..63da798b 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1626,8 +1626,9 @@ const Buffer = Module("buffer", { return false; let computedStyle = util.computedStyle(elem); + let rect = elem.getBoundingClientRect(); return computedStyle.visibility != "hidden" && computedStyle.display != "none" && - computedStyle.MozUserFocus != "ignore"; + computedStyle.MozUserFocus != "ignore" && rect.width && rect.height; }); dactyl.assert(elements.length > 0); diff --git a/common/content/commands.js b/common/content/commands.js index 92b1626b..5a95bae0 100644 --- a/common/content/commands.js +++ b/common/content/commands.js @@ -285,6 +285,8 @@ const Command = Class("Command", { */ replacementText: null }, { + bindMacro: function (args, default_) { + }, // TODO: do we really need more than longNames as a convenience anyway? /** diff --git a/common/locale/en-US/repeat.xml b/common/locale/en-US/repeat.xml index 96641bd4..5533f47c 100644 --- a/common/locale/en-US/repeat.xml +++ b/common/locale/en-US/repeat.xml @@ -254,14 +254,14 @@ \ p:first-line { font-variant: small-caps; } \ div#side-bar > :first-child { display: none; } -:command do-some-stuff +:command! do-some-stuff \ -description A command which does some stuff in JavaScript \ :javascript <<EOF \ window.do(some); \ window.do(stuff); \EOF -:command do-some-stuff +:command! do-some-stuff \ -description A command which does some stuff in JavaScript \ :javascript \\ window.do(some);