1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-22 00:47:59 +01:00

Fix hints with body { position: relative; }

This commit is contained in:
Kris Maglione
2009-08-28 13:04:26 -04:00
parent 53a6d8c6ef
commit 3d8aa842da

View File

@@ -273,6 +273,13 @@ function Hints() //{{{
return [leftpos, toppos];
}
function getBodyOffsets(doc)
{
let bodyRect = (doc.body || doc.documentElement).getBoundingClientRect();
return [doc.defaultView.scrollX - bodyRect.left,
doc.defaultView.scrollY - bodyRect.top];
}
/**
* Generate the hints in a window.
*
@@ -288,8 +295,7 @@ function Hints() //{{{
let doc = win.document;
let height = win.innerHeight;
let width = win.innerWidth;
let scrollX = doc.defaultView.scrollX;
let scrollY = doc.defaultView.scrollY;
let [scrollX, scrollY] = getBodyOffsets(doc);
let baseNodeAbsolute = util.xmlToDom(<span highlight="Hint"/>, doc);
@@ -395,8 +401,7 @@ function Hints() //{{{
for (let [,{ doc: doc, start: start, end: end }] in Iterator(docs))
{
let scrollX = doc.defaultView.scrollX;
let scrollY = doc.defaultView.scrollY;
let [scrollX, scrollY] = getBodyOffsets(doc);
inner:
for (let i in (util.interruptibleRange(start, end + 1, 500)))