Firefox 32.0.3 does not detect properly screen.width and inner.width
Please follow this link: http://www.casapineda.info/test
This is a test page. There is a simple javascript launching an alert. The first line in the alert displays screen.width The second line displays inner.width
My screen is 1920 x 1080. With the browser maximized, Firefox may display the alert correctly the first time but if the page is reloaded then it displays:
Screen: 1536 x 864 Inner: 1536 x 750
By the way, I have restarted Firefox with factory settings without success.
This odd behaviour is producing undesirable effects in the items depending on screen or browser size. The following items display incorrectly:
Fonts: they tend to display bigger and thiker Images: they appear bigger
Firefox has been compared with the following other browsers , none of them present the same misfunction:
- Goggle Chrome - Opera - Safari - And even IE8!
All Replies (6)
hello, have you set any other dpi value in your operating system than the default one (96dpi)? more information about that is available at http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/display_use_large_or_small_fonts.mspx
firefox will adhere to these settings done on the system level in order to support high-pixel-density displays...
Very good guess! My setting was 120 dpi.
I have now set it at 96 dpi. Now Firefox, in the test described above, tells me that my screen is:
2144 x 1206 (Liar! Should be 1920 x 1080) !
After reloading he tells me the truth: 1920 x 1080.
I find this is a very odd behaviour that none of the other browsers presents.
I am not bothered with my own use of FF. What I'm bothered about is that other users of FF do not see certain Internet sites the way they were intended to display and these users, trusting FF, do not know that these problems would not exist if they used other browsers. They tend to blame the sites, not FF.
Can this behaviour be corrected while preserving optimal performance of FF in the other aspects? Perhaps in a future version?
firefox respects the system's dpi settings and adjusts the contents accordingly (this is used to support hidpi displays - other browsers may follow), so i think that it will report the upscaled/downscaled size to websites is something to be expected, so they can adapt to the situation. what bugs me here is that you get the wrong result when you try to first load the page - is this something that you can replicate when you launch firefox in safe mode once? (it works correctly for me when i test it on the mentioned site) Troubleshoot extensions, themes and hardware acceleration issues to solve common Firefox problems
. . . what bugs me here is that you get the wrong result . . . . .it works correctly for me . . .
The "problem" is fixed and I do not know why.
This is what I did:
I set again my Windows to 96 dpi and I restarted the computer.
Following your suggestion, I first started FF in safe mode. No improvement. It kept on displaying wrong figures in the alert and also displayed wrong (larger) image and table-cell sizes in my test page.
Then I started FF "as it comes out from factory" : this corrected the whole situation.
Then I performed a general test of browser behaviour:
Knowing that my screen is 1920 pixels wide and that my fuchsia image and violet table cell are set to 1024px, in my test page . . . I measured the horizontal physical cm with a ruler.
ALL BROWSERS displayed the objects consistently of 271 mm in a 509 mm wide screen.
(271/509)x1920 = 1022 px
1022 against 1024 is a very small difference due to measuring inconsistencies.
- - -
For me the situation is solved and perhaps no more can be done about it. But I continue being worried about other people blaming the sites and not the browser for the same display inconsistencies.
Time ago, perhaps 3 or more years, when I detected the same problem I updated the version. After some time I updated the version again until I did the last update 10 months ago. The problem persisted.
In the last months, however, I begun being involved in responsive webs and then the nightmare begun. I compared my results with other people's and because the same was also happening to other persons I concluded that FF was perhaps substandard and that its development perhaps needed a gentle push.
This thought was what impelled me to submit again the same question submited the 10th of February this year without reaching the point we have attained now. - - -
Last but not least I wish to congratulate you for your insight and also to thank you for your valuable help.
Zooming a page also affects how the current dimensions are reported, so you may have to reset the zoom or clear the Site Preferences.
Cor-el: Zoom was a matter mentioned our earlier contacts. You suggested zoom and I said that this was the first thing I had looked.
In a later post you said Did you make changes to the DPI settings in Windows or in Firefox?
layout.css.devPixelsPerPx layout.css.dpi
Although I now realise that I had made changes in Windows DPI, at that moment I was confused perhaps because I focused my attention in the later wording ... layout. xxxxx ... and I said I didn't even know what you were talking about.
DPI settings in Windows have not solved the misbehaviour, however.
The Site Preferences you just mentioned now had never been touched. In fact I have had now to ask Mr. Google because I couldn't find this item.
The situation has come to an end after letting FF "start as it comes from factory" without knowing really in what point was the problem.
I wish to thank you for your co-operation.