[Webkit-unassigned] [Bug 21413] New: DOMWindow.cpp DOMWindow::moveTo offsets moves by 22 (menu bar height)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Oct 6 15:09:08 PDT 2008


https://bugs.webkit.org/show_bug.cgi?id=21413

           Summary: DOMWindow.cpp DOMWindow::moveTo offsets moves by 22
                    (menu bar height)
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Macintosh
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: HTML DOM
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: esimenel at adobe.com


Easy to reproduce:
Using the following HTML code:
<html>
<script>
    function M(dx, dy) {

        window.moveTo(window.screenX+dx, window.screenY+dy);
    }

</script>
<body>
<input type="button" value="move me" onclick="M(0, -50)">
</body>
</html>

Safari/Webkit windows move up 28 pixels, Firefox windows move up 50 pixels.

Tentative fix:

Instead of:
    FloatRect fr = page->chrome()->windowRect();
    FloatRect sr = screenAvailableRect(page->mainFrame()->view());
    fr.setLocation(sr.location());
    FloatRect update = fr;
    update.move(x, y);     

We should have:
    FloatRect fr = page->chrome()->windowRect();
    FloatRect sr = screenAvailableRect(page->mainFrame()->view());
    x -= fr.x();
    y -= fr.y();
    FloatRect update = fr;
    update.move(x, y);     

That change seems to fix the problem.


-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.



More information about the webkit-unassigned mailing list