Last Comment Bug 934604 - Firefox incorrectly reports window.devicePixelRatio when you use the browser page zoom function
: Firefox incorrectly reports window.devicePixelRatio when you use the browser ...
Status: RESOLVED DUPLICATE of bug 809788
:
Product: Core
Classification: Components
Component: DOM: Core & HTML (show other bugs)
: 24 Branch
: x86_64 Windows 7
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-11-04 11:46 PST by Bestekov
Modified: 2015-02-14 16:57 PST (History)
4 users (show)
bzbarsky: needinfo? (owen.beste+bugzilla)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments

Description Bestekov 2013-11-04 11:46:29 PST
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.
Comment 1 Liz Henry (:lizzard) (needinfo? me) 2013-11-04 15:12:32 PST
I see this in Aurora and Nightly. The graph shows at some levels of zoom, but not all of them.
Comment 2 Boris Zbarsky [:bz] 2013-11-04 18:40:41 PST
> 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?
Comment 3 Alex 2013-11-04 19:00:13 PST
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.
Comment 4 Boris Zbarsky [:bz] 2013-11-04 19:09:28 PST
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....
Comment 5 Jonathan Watt [:jwatt] 2015-02-14 16:57:02 PST

*** This bug has been marked as a duplicate of bug 809788 ***

Note You need to log in before you can comment on or make changes to this bug.


Privacy Policy