Marcos Cruz <[email protected]> wrote:
> I've just visited a page that still uses frames (http://microhobby.org),
> and the link hinting works only in the menu frame, even after clicking
> the main one.
> 
> Beside, sometimes the hintings remain active and no key works anymore.
> The only thing you can do is to click links. This is the first time this
> error happens, and I guess it has something to do with frames.
> 
> I've found nothing about frame selection or frame focus in the man page
> or the wiki.
> 
> Is there any way to select the desired frame for link hinting?

In this case this seems to be a bug in the hinting script. I don't know what's
wrong with it. I've made a patch that solves the issue for me, but it's not
tested very well.

Daniel
From ff907b5161953a86fa2e6569e15903d7d912efbf Mon Sep 17 00:00:00 2001
From: Daniel Carl <[email protected]>
Date: Sat, 20 Dec 2014 23:14:02 +0100
Subject: [PATCH] Fixed none working hints in frames.

---
 hinting.js | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/hinting.js b/hinting.js
index 4997cae..b46445b 100644
--- a/hinting.js
+++ b/hinting.js
@@ -114,17 +114,15 @@ function Hints() {
             doc.documentElement.appendChild(hintContainer);
 
             /* recurse into any iframe or frame element */
-            var frameTags = ["frame","iframe"];
-            for (var f = 0; f < frameTags.length; ++f) {
-                var frames = doc.getElementsByTagName(frameTags[f]);
-                for (i = 0, nframes = frames.length; i < nframes; ++i) {
-                    elem = frames[i];
-                    rect = elem.getBoundingClientRect();
-                    if (!elem.contentWindow || !rect || rect.left > maxX || rect.right < minX || rect.top > maxY || rect.bottom < minY) {
-                        continue;
-                    }
-                    helper(elem.contentWindow, offsetX + rect.left, offsetY + rect.top);
+            var i, frame;
+            for (i = 0; i < win.frames.length; i++) {
+                frame = win.frames[i];
+                elem  = frame.frameElement;
+                rect = elem.getBoundingClientRect();
+                if (!elem.contentWindow || !rect || rect.left > maxX || rect.right < minX || rect.top > maxY || rect.bottom < minY) {
+                    continue;
                 }
+                helper(elem.contentWindow, offsetX + rect.left, offsetY + rect.top);
             }
         }
 
-- 
2.2.1

Attachment: pgpiUp3WuxEFx.pgp
Description: PGP signature

------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk
_______________________________________________
Vimprobable-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/vimprobable-users

Reply via email to