Bug 63333 - CSS zoom property incorrectly affects offset
Summary: CSS zoom property incorrectly affects offset
Status: RESOLVED DUPLICATE of bug 39924
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
Depends on:
Reported: 2011-06-24 10:51 PDT by Malcolm MacLeod
Modified: 2011-06-24 11:24 PDT (History)
1 user (show)

See Also:

test (848 bytes, text/html)
2011-06-24 11:07 PDT, Emil A Eklund
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Malcolm MacLeod 2011-06-24 10:51:34 PDT
When CSS zoom is applied to an element the element can return incorrect offset values as a results (even though it continues to display in the correct place), seemingly the code to fill in the offsets automatically assumes that the element itself has been affected by the zoom without actually checking to ensure this is the case.

Steps to reproduce:
1) Open attached testcase "zoombug.html"
2) click through 3 alert messages observing the offsetLeft value that it displays
3) observe that in each case the actual position of the div has not changed
4) observe that only the content inside the div that is zoomed the page around the div and the div itself are not affected by the zoom
5) observe that in each case the offsetLeft value of the element does change despite the fact that it is clearly offset by the exact same amount it was previously
Comment 1 Emil A Eklund 2011-06-24 11:07:52 PDT
Created attachment 98513 [details]

I assume you meant to upload a copy of the test.
Comment 2 Emil A Eklund 2011-06-24 11:10:53 PDT

*** This bug has been marked as a duplicate of bug 39924 ***
Comment 3 Malcolm MacLeod 2011-06-24 11:18:43 PDT
Yes sorry, forgot to upload test thanks. Not entirely sure this is a duplicate of 39924 as in the case of 39924 the whole page is zoomed and the offsets of the elements do actually change visually. In this case the element does not move at all.
Comment 4 Emil A Eklund 2011-06-24 11:24:30 PDT
No worries, we'll make sure to run your test case when fixing 39924.
Thanks for the report and the reduced test!