Closed Bug 855358 Opened 11 years ago Closed 11 years ago

Zoom in on Web Page Gives Incorrect Window and Screen Size


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

20 Branch
Not set





(Reporter: kthrose, Unassigned)



User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.22 (KHTML, like Gecko) Chrome/25.0.1364.172 Safari/537.22

Steps to reproduce:

Zoom in on any web page, console.log window.outerWidth, window.outerHeight, screen.width and screen.height

Actual results:

Screen and Window size change when you zoom in - this does not happen in Chrome V8.

Expected results:

This is somewhat useful as a developer, because it allows me to trigger media queries by zooming out. But it's very, very painful when your client side JavaScript is depending on accurate values.
FYI! - This is not true on my Mac OSX Mountain Lion computer with FF version 19. This bug was from Windows 7 machine with Firefox 20.0.
Those values depend on the zoom level even in firefox-4.0b3pre.2010-08-01-03.en-US.linux-x86_64
Core::Layout or Core::DOM

Might be related: bug 435275, bug 594140.
Component: Untriaged → Layout
Product: Firefox → Core
Depends on: 418986
Component: Layout → DOM
No longer depends on: 418986
Depends on: 418986
All the values you mention are measured in CSS pixels.

Zooming changes the size of a CSS pixel (not in Chrome, but in Gecko; Chrome and Gecko have very different "zooming" implementations, with quite different behavior in many cases).

So when you zoom, the measured size of the screen in CSS pixels will change, since the size of a CSS pixel changed.

I'm not sure what you mean by "accurate values", but you don't have them anyway in the sense that CSS pixels don't necessarily match device pixels and the brower's concept of screen.width doesn't match what the OS thinks of as the screen width in any case.
Closed: 11 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.