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)
Core
DOM: Core & HTML
Tracking
()
VERIFIED
FIXED
M13
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)
(deleted),
text/html
|
Details |
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.
Updated•25 years ago
|
Assignee: vidur → joki
Comment 1•25 years ago
|
||
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.
screen.height screen.width screen.availHeight screen.availWidth
screen.colorDepth all return -1 in gecko m6 mac pp
Comment 4•25 years ago
|
||
Updated•25 years ago
|
Whiteboard: [TESTCASE] window.screen[X|Y] return 0 on Mac
Comment 5•25 years ago
|
||
testcase is excellent; could not reproduce this on Windows and Linux. For error
report see desale@netscape.com's original posting.
Reporter | ||
Comment 6•25 years ago
|
||
I just tested it with todays builds [08-16-09]. And its happening on Linux too.
Comment 7•25 years ago
|
||
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().
Updated•25 years ago
|
Target Milestone: M14
Updated•25 years ago
|
Assignee: joki → danm
Comment 8•25 years ago
|
||
Reassigned to danm since he worked on it already, as well as on related issues on
other platforms.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 10•25 years ago
|
||
bite me, bugzilla
Reporter | ||
Updated•25 years ago
|
Status: RESOLVED → REOPENED
Reporter | ||
Comment 11•25 years ago
|
||
I tested this one with 2000-01-11-10 build on Linux and failure seems to be
still there.
Reopening bug.
Reporter | ||
Updated•25 years ago
|
Resolution: FIXED → ---
Reporter | ||
Updated•25 years ago
|
Whiteboard: [TESTCASE] window.screen[X|Y] return 0 on Mac → [TESTCASE] window.screen[X|Y] return 0 on Mac as well as Linux.
Reporter | ||
Comment 12•25 years ago
|
||
Clearing Resolution.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 13•25 years ago
|
||
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.
Assignee | ||
Comment 14•25 years ago
|
||
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.
Comment 15•25 years ago
|
||
Clearing FIXED resolution due to reopen.
Status: REOPENED → RESOLVED
Closed: 25 years ago → 25 years ago
Resolution: --- → FIXED
Assignee | ||
Comment 16•25 years ago
|
||
Clearing silly clearing of fixed resolution due to my wanting to.
But see above notes about but 23779.
You need to log in
before you can comment on or make changes to this bug.
Description
•