Summary: | Regression from r41207 | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Scott Violet <sky> | ||||||
Component: | WebCore Misc. | Assignee: | Nobody <webkit-unassigned> | ||||||
Status: | RESOLVED INVALID | ||||||||
Severity: | Normal | CC: | sam | ||||||
Priority: | P2 | Keywords: | Regression | ||||||
Version: | 528+ (Nightly build) | ||||||||
Hardware: | PC | ||||||||
OS: | Windows XP | ||||||||
Attachments: |
|
Description
Scott Violet
2009-03-06 10:05:28 PST
Created attachment 28365 [details]
Test case for bug
To repro do the following:
1. Click the button.
2. Notice the red div appears right beneath the button.
3. vertically scroll a bit.
4. click the button again.
Notice the red div is no longer placed beneath the button.
The script in the test is rather ugly as it's reduced from a real page. I could certainly create a more reduced test case, but I thought you might want to see how this ever worked prior to adding getBoundingClientRect.
FF's getBoundingClientRect is relative to the viewport, just as ours is after Sam landed 41207. Given that, I suspect this is a bug in the page. The page is assuming 'window.document.documentElement.scrollTop' returns the vertical offset, but that doesn't appear to have ever been the case in WebKit. It works in FF though. I'm going to leave open just to make sure this was intentional. Sam, please close if you think this is a bug in the page. Created attachment 28367 [details]
Reduced test case
Here's a more reduced test case given my knowledge of the bug. It basically comes down to repositioning a div with the following code:
var scrollTop = window.document.documentElement.scrollTop;
var targetYLoc = target.getBoundingClientRect().top;
var b = document.getElementById("adiv");
b.style.top = (scrollTop + targetYLoc) + "px";
I suspect this is a bug in your page since we match Firefox. |