[Webkit-unassigned] [Bug 16143] New: Window locations are invalid when generated from "onunload" event

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Nov 26 10:14:01 PST 2007


           Summary: Window locations are invalid when generated from
                    "onunload" event
           Product: WebKit
           Version: 523.x (Safari 3)
          Platform: Macintosh
               URL: http://homepage.mac.com/adjensen/other/windowA.html
        OS/Version: Mac OS X 10.5
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: dale.jensen at ntractive.com

I'm working on a function to save and restore window positions, and am running
into a snag.  I have a function in the base of window "A" that opens window "B"
and also has a function that receives a message back from the popup.

To wit:

Window "A":
 function saveWindowLocation(windX, windY) {
alert(windX + ', ' + windY);

Window "B":
function saveWindowLocation(windowName) {
windX = window.screenX;
windY = window.screenY;
opener.top.saveWindowLocation(windX, windY);
 ( and )
<body onunload="saveWindowLocation('mywindow');">


That seems, to me, to be the way that I pass back the screen coordinates that
were active when the window closed.  However, I always get "0, 900" in my
alert.  If I move the windX and windY assignments out of the function (so that
they are assigned when the window is first loaded,) I do get the correct
values.  However, if the window is dragged around, the values are wrong, and
that's kind of the whole point.  I can't find a webkit equivalent of "onmove",
so my only solution is to keep checking the values periodically, which seems
really inefficient.

So, two parts:

1) Why, when "saveWindowLocation" is called on "onunload" (if it's called
otherwise, it works perfectly,) is it passing back zero and nine hundred,
regardless of location
2) Is there a webkit equivalent of the "onmove" event to sort out when a window
is moved?


Configure bugmail: http://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