Closed Bug 5998 Opened 25 years ago Closed 25 years ago

[PP]window.screenX and window.screenY return "0" all the time.

Categories

(Core :: DOM: Core & HTML, defect, P3)

defect

Tracking

()

VERIFIED FIXED

People

(Reporter: desale, Assigned: danm.moz)

References

Details

(Whiteboard: [TESTCASE] window.screen[X|Y] return 0 on Mac as well as Linux.)

Attachments

(1 file)

window.screenX and window.screenY return "0" all the time. Even if you try to change it throug code, it does show window moving sometimes [not all the times], but command itself returns "0". On windows everything works fine, its only problem with Mac OS. Product: Semonkey [Apprunner/Viewer]. Build: 05-04-08. OS: MacOS. Steps to Reproduce: 1] Please copy code I'm providing. 2] Save as HTML file and open this HTML file in apprunner as well as viewer. 3] This HTML file will show you values of screenX and screenY 11 times since code is using those commands in loop. [code uses window.screenX, and window.screenY in loop ] Expected Results: Each command should return actual x-cordinate and y-cordinate and it should get printed on screen as follows. window.screenX = 10 & window.screenY = 10 window.screenX = 0 & window.screenY = 0 window.screenX = 1 & window.screenY = 1 window.screenX = 2 & window.screenY = 2 window.screenX = 3 & window.screenY = 3 window.screenX = 4 & window.screenY = 4 window.screenX = 5 & window.screenY = 5 window.screenX = 6 & window.screenY = 6 window.screenX = 7 & window.screenY = 7 window.screenX = 8 & window.screenY = 8 window.screenX = 9 & window.screenY = 9 window.screenX = 10 & window.screenY = 10 Actual Results: Each command returns "0" and it gets printed on screen as follows. window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 window.screenX = 0 & window.screenY = 0 Code: <html> <head> <title>Test Page</title> </head> <body > <form name="workform"> <SCRIPT LANGUAGE="JavaScript1.1"> document.writeln("<h3>"); document.writeln("Window screenX and screenY"); document.writeln("</h3>"); document.writeln("window.screenX = "); document.writeln(window.screenX); document.writeln("&"); document.writeln("window.screenY = "); document.writeln(window.screenY); document.writeln("<br>"); var i=0; var x=0; var y=0; while(i<11){ window.screenX=x; window.screenY=y; document.writeln("window.screenX = "); document.writeln(window.screenX); document.writeln("&"); document.writeln("window.screenY = "); document.writeln(window.screenY); document.writeln("<br>"); i++; x++; y++; } </SCRIPT> </form> </body> </html> End of Code.
Assignee: vidur → joki
More window stuff for you, Tom.
Summary: window.screenX and window.screenY return "0" all the time. → [PP]window.screenX and window.screenY return "0" all the time.
Putting on [PP] radar.
screen.height screen.width screen.availHeight screen.availWidth screen.colorDepth all return -1 in gecko m6 mac pp
Whiteboard: [TESTCASE] window.screen[X|Y] return 0 on Mac
testcase is excellent; could not reproduce this on Windows and Linux. For error report see desale@netscape.com's original posting.
I just tested it with todays builds [08-16-09]. And its happening on Linux too.
That's because nsWebShellWindow::GetWindowBounds() returns the rect from mWindow->GetBounds() directly. The fix is to convert that rect to global coordinates by calling mWindow->WidgetToScreen().
Target Milestone: M14
Assignee: joki → danm
Reassigned to danm since he worked on it already, as well as on related issues on other platforms.
*** Bug 11940 has been marked as a duplicate of this bug. ***
Status: NEW → ASSIGNED
Target Milestone: M14 → M13
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
bite me, bugzilla
Status: RESOLVED → REOPENED
I tested this one with 2000-01-11-10 build on Linux and failure seems to be still there. Reopening bug.
Resolution: FIXED → ---
Whiteboard: [TESTCASE] window.screen[X|Y] return 0 on Mac → [TESTCASE] window.screen[X|Y] return 0 on Mac as well as Linux.
Clearing Resolution.
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Alright, now it's fixed on *gtk*, too. Really a separate bug. You'll notice when you try to verify this, though, that while it no longer returns (0,0) on linux (without deliberate window placement, anyway), it will return unexpected numbers which don't match the other platforms'. That's not this bug. That's bug 23779.
Status: RESOLVED → REOPENED
temporarily reopening -- i changed the bug report before i checked in the code, and then someone killed the tree. i'll reclose when i have a chance to check in the change.
Resolution: FIXED → ---
Clearing FIXED resolution due to reopen.
Status: REOPENED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → FIXED
Clearing silly clearing of fixed resolution due to my wanting to. But see above notes about but 23779.
Verified with 02-18-09.
Status: RESOLVED → VERIFIED
OS: Mac System 8.5 → All
Hardware: PC → All
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: