Bug 155913 - [patch] www/firefox ignores DPI settings
Summary: [patch] www/firefox ignores DPI settings
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-gecko (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-24 14:00 UTC by kamikaze
Modified: 2011-03-24 19:33 UTC (History)
0 users

See Also:


Attachments
file.diff (3.83 KB, patch)
2011-03-24 14:00 UTC, kamikaze
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description kamikaze 2011-03-24 14:00:01 UTC
Firefox4 ignores system DPI and the DPI settings in layout.css.dpi.

The following patch can be dropped into www/firefox/files/ as is. I have submitted to bugzilla.mozilla.org (https://bugzilla.mozilla.org/show_bug.cgi?id=603880). However I doubt it will be accepted anytime soon (the original bug reports is months old and does not even have confirmed status).

This is why I want to suggest adding the patches to the FreeBSD ports tree, the following explanation is taken from my submission to mozilla.

Fix: gfx/src/thebes/nsThebesDeviceContext.cpp
Issue:
- The PR_MAX macro is used in an unsafe fashion, with function calls as
  parameters. Every function in the call is thus called twice, leading
  to several variables being set to 0 (at least when compiled under
  FreeBSD)
Fix:
- Only forward variables to the PR_MAX macro

layout/style/nsCSSValue.h
layout/style/nsCSSValue.cpp
layout/mathml/nsMathMLFrame.cpp
layout/style/nsRuleNode.cpp
Issue:
- The GetPixelLength() function is hard-coded to 96 DPI
Fix:
layout/style/nsCSSValue.h
- Change signature of GetPixelLength() to take an nsPresContext argument
layout/style/nsCSSValue.cpp
- Use AppUnitsPerPhysicalInch() / AppUnitsPerDevPixel() from the
  context to determine the real DPI as determined by thebes
layout/mathml/nsMathMLFrame.cpp
layout/style/nsRuleNode.cpp
- Update all calls of GetPixelLength() to the new signature


Patch attached with submission follows:
How-To-Repeat: Check:
http://www.home.hs-karlsruhe.de/~fado0001/testdpi.html

Change your system DPI settings or play with the layout.css.dpi setting. You will notice, none of these things have an effect.
Comment 1 Edwin Groothuis freebsd_committer 2011-03-24 14:00:26 UTC
Responsible Changed
From-To: freebsd-ports-bugs->gecko

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Beat Gaetzi freebsd_committer 2011-03-24 19:28:52 UTC
State Changed
From-To: open->closed

Thanks for your patch. This patch should go upstream as we try to avoid 
adding local patches for non-critical bugs.