Closed Bug 934604 Opened 11 years ago Closed 10 years ago

Firefox incorrectly reports window.devicePixelRatio when you use the browser page zoom function

Categories

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

24 Branch
x86_64
Windows 7
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 809788

People

(Reporter: owen.beste+bugzilla, Unassigned, NeedInfo)

Details

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:24.0) Gecko/20100101 Firefox/24.0 (Beta/Release)
Build ID: 20130910160258

Steps to reproduce:

This issue was discovered while using the cytoscape.js graph visualization library. Reference https://github.com/cytoscape/cytoscape.js/issues/372

Steps to reproduce:
1. Open the example cytoscape page in firefox: http://jsbin.com/urabis/8/edit
2. Press ctrl + or ctrl - to zoom in or out
3. Move your mouse cursor
4. Observe that the graph disappears
5. Press ctrl + 0 to restore to default zoom level
6. Observe that the graph returns to normal.


Actual results:

At any browser zoom level other than default, the graph does not render correctly. Resetting to default resolves the issue.  After analysis by the cytoscape.js team, they identified this as firefox bug with window.devicePixelRatio reporting incorrect values.
I see this in Aurora and Nightly. The graph shows at some levels of zoom, but not all of them.
Status: UNCONFIRMED → NEW
Component: Untriaged → DOM: Core & HTML
Ever confirmed: true
Product: Firefox → Core
> they identified this as firefox bug with window.devicePixelRatio reporting incorrect
> values.

Incorrect in what way?  When you zoom by changing CSS pixel scaling, as here, window.devicePixelRatio can (correctly) become a non-integer.  Are they assuming it's always an integer, by any chance?
Flags: needinfo?(owen.beste+bugzilla)
IE11 is equally as broken as Firefox is when zooming, since they also report the correct values for devicePixelRatio it looks like a bug in the JS library.
To be clear, WebKit-based browsers (Safari and Chrome) do have a busted devicePixelRatio implementation: in those browsers it's not the ratio of CSS to device pixels but some made-up quantity (default-zoom CSS pixels) to device pixels.  So in particular, in those browsers zooming incorrectly doesn't change devicePixelRatio.  It's possible the library authors only bothered to test in those browsers and assumed their behavior was correct....
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.