|Subject:||IE8 BHO getBoundingClientRect wrong on zoom - any workarounds?|
|Posted by:||Gaga (ns.ga…@gmail.com)|
|Date:||Tue, 26 May 2009|
I have a BHO that works for some time, IE6/IE7 and relies heavily on
element positions, 'picking' as I like to call it. As soon as I tested
on IE8 it failed miserably - at least in 'zoom mode' - traced it down
to getBoundingClientRect - which seems completely off the charts...
this seems to be a know bug w IE8 (I've seen Google maps reporting
issues w/ positions) and fail over to 'compatibility' mode seems to
getBoundingClientRect seems awfully consistent no matter what...
description: getBoundingClientRect is reporting wrong values when page
is zoomed, in our out - and what's more seems 'reverse proportional'
in a way - e.g. if you zoom-in (bigger page) coordinates decrease - if
out they increase, wacky...
when in 100% mode all is fine
- I traversed, traced all HTML elements, all are consistent - just 'as
if' zoom direction is reverted,
- I tested offsets method (for calculating positions/locations) and
also IDisplayServices.TransformPoint/Rect - all behave very
consistently (are the same as the getBoundingClientRect) and exhibit
the same problems,
- that also prevents me from 'calculating' the zoom (via that IE7
method on the body) even though not sure if that would help any even
if I could + it's not an 'exact' solution,
- I also tried thinking of it as some form of a 'new coordinate
system', but cannot seem to deduce or 'reverse engineer' what it could
- getElementFromPoint fails as well - though that may be interpreted
in different ways,
So, has anybody managed to work around it somehow? - or at least can
confirm this, when it'd be solved, anything is welcome