Zoom in on Web Page Gives Incorrect Window and Screen Size

RESOLVED INVALID

Status

()

Core
DOM
RESOLVED INVALID
5 years ago
4 years ago

People

(Reporter: Keith Rosenberg, Unassigned)

Tracking

20 Branch
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
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.
(Reporter)

Comment 1

5 years ago
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.

Comment 2

4 years ago
Those values depend on the zoom level even in firefox-4.0b3pre.2010-08-01-03.en-US.linux-x86_64

Comment 3

4 years ago
Core::Layout or Core::DOM

Might be related: bug 435275, bug 594140.
Component: Untriaged → Layout
Product: Firefox → Core

Updated

4 years ago
Depends on: 418986

Updated

4 years ago
Component: Layout → DOM

Updated

4 years ago
No longer depends on: 418986

Updated

4 years ago
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.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 4 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.