Closed Bug 133483 Opened 24 years ago Closed 24 years ago

JavaScript does not update window.screen object on resolution change.

Categories

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

x86
Windows 98
defect
Not set
normal

Tracking

()

VERIFIED DUPLICATE of bug 62395
Future

People

(Reporter: achowe, Assigned: jst)

References

()

Details

Attachments

(1 file)

From Bugzilla Helper: User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:0.9.9) Gecko/20020311 BuildID: 2002031104 JavaScript does not update window.screen object on resolution change. Suspect that the Window.screen properties are not being updated when screen resolution changes while Mozilla is running. The Stars'n'Bars web site has two versions: an old one and a new one designed for 1024x769 screen. The index.html page has JavaScript to test and load the best version based on screen size. While testing this JavaScript, I had need to flip between screen resolutions and then force reload the base URL to see if it would correctly select between different versions. It failed. Reproducible: Always Steps to Reproduce: 1. Start in screen resolution 1024x768 or better. 2. Load http://www.starsnbars.com/ 3. Lower the screen resolution to 800x600 4. Force reload http://www.starsnbars.com/ Actual Results: At step 4, the page loaded for the higher resolution remains. Expected Results: The pages displayed for steps 2 and 4 should be different depending on your screen resolution. This JavaScript works fine in Netscape 4.79 and IE 6 without the need to stop/start the browser, but fails for Netscape 6.2 and Mozilla. Currently the only way to get Mozilla to display the correct page is to stop/start Mozilla and go to the web site.
Browser, not engine ---> DOM Level 0, although I'm not sure this has to do with window.screen in the DOM, or something at a lower level... Anthony: did this ever work correctly in Mozilla, that you know of?
Assignee: rogerl → jst
Component: JavaScript Engine → DOM Level 0
QA Contact: pschwartau → desale
Here is the JavaScript Anthony was referring to, used at the site: <script language="JavaScript1.2"> // Select new or old web site based on screen size. if (1024 <= window.screen['width'] && 768 <= window.screen['height']) location.href = 'frameset.html'; else location.href = 'starsold/main.shtml'; </script>
Attached file Reduced HTML testcase —
Confirming bug with Mozilla trunk binary 20020322xx on WinNT. STEPS TO REPRODUCE 1. Load the reduced testcase 2. It alerts window.screen.width and window.screen.height 3. Change your screen resolution with Mozilla still up. 4. Reload or Shift+Reload the testcase 5. The values have not changed, even though your screen has! 6. Close and restart Mozilla 7. Load the testcase again 8. The new screen values are now correctly displayed
Status: UNCONFIRMED → NEW
Ever confirmed: true
This is the first time I've tried something like this. I normally use Netscape 6.2, but with the recent Mozilla 0.9.9 release I've been playing with Mozilla more. Since Netscape 6.2 and Netscape 6.2.2 both fail, and Mozilla 0.9.9 fails, I would guess this has been a bug for some time.
Given how infrequently people tend to change their screen resolution I'm Futuring this bug, sure it should be fixed, but there are tons of other more important issues that need attention before this one. I think this might be a dup though, but I can't find the other bug right now.
Target Milestone: --- → Future
Looks like this bug is in fact a duplicate of bug 62395, "window.screen properties do not change when screen depth and size is changed" Resolving as duplicate. Anthony, you will be cc'ed on the other bug so you may follow its progress - *** This bug has been marked as a duplicate of 62395 ***
Status: NEW → RESOLVED
Closed: 24 years ago
Resolution: --- → DUPLICATE
verified.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: