PeterFacey
unread,Jun 26, 2010, 2:44:13 PM6/26/10Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Chromium-extensions
I have a content script that examines the offsetTop values of various
<DIV> elements of the DOM in order to calculate a distance to scroll
the page. It works in Firefox at all VIEW/ZOOM levels, and in Chrome
provided the zoom level is normal (CTRL+0). At larger zoom levels (CTRL
++) in Chrome it gets an amount that is too small.
I examined the offsetTop values of two <DIV> elements in Developer
Tools. These <DIV>s render one above the other in the browser window.
At normal zoom, the two offsetTop values are 221 and 411. Difference
is 190. Vertical separation on screen is 48 mm (measured with a
ruler).
At higher zoom, the two offsetTop values are 260 and 449. Difference
is 189. Vertical separation is 57 mm.
Thus, although the vertical separation on screen has increased due to
the higher zoom level, as one would expect it to, the figures returned
from the DOM do not reflect that.
Is this a bug or a feature of Chrome? If it is a feature, I suppose I
have to multiply all vertical pixel positions by a factor dependent
upon the zoom level?