Open Bug 374775 Opened 18 years ago Updated 8 months ago

Bug in AppUnitsPerDevPixel calculation

Categories

(Core :: Layout: Block and Inline, defect)

x86
Linux
defect

Tracking

()

People

(Reporter: mpgritti, Unassigned)

Details

Attachments

(2 files, 1 obsolete file)

Attached patch One line fixSplinter Review
The problem is very easy to reproduce in Firefox. 1 Go to about:config and change the layout.css.dpi to 143 2 Open the attached testcase. -> Small font (like at 96 dpi) 3 Go to about:config and change the layout.css.dpi to 144 4 Reopen the attached testcase, reload the page to make sure everything is updated. -> Big font The comment above the code is a bit confusing but if I get it correctly we are just rounding too early. I'm also going to attach a patch.
Attached file Testcase
I think this behaviour is desired. What do you expect? We require that the ratio of device pixels to CSS pixels be an integer, or all kinds of things are going to break.
Ok, I see now that this was discussed in #177805. The OLPC have a screen size of 1200x900, dpi 201. If we set layout.css.dpi to 201 fonts, images and any other element on the page becomes too big to fit into the screen. Setting a smaller dpi (e.g. 130) fonts specified in css pixels becomes too small to be readable. Is there a good solution to this problem? Should we do layout at 201 dpi but zooming out the web page by changing the active transformation in the device context?
At some point we're going to have to add a zooming interface to the browser to help with sites. How would that be handled?
I see. The "right" way to do scaling is to set a transformation in the device context. But scaling would mean CSS lengths don't correspond to real lengths. In your case, you might actually be best off allowing the ratio of device pixels per CSS pixel to not be an integer (i.e. with a patch like this). See how it goes. I'm not sure it's a good idea but if it works for you that'd be interesting to know. You may find some content being antialiased inappropriately or encounter subtle layout issues. I don't think we should do this in the Mozilla tree though, at least not yet. Instead of this patch, all you need to do, actually, is set dotsArePixels to false and then we take a path that doesn't do the rounding. We could accept a patch to make that controllable via a pref or something.
(In reply to comment #4) > At some point we're going to have to add a zooming interface to the browser to > help with sites. How would that be handled? For that you probably want to set a transform in the device context.
Reassigning bug; I'm not planning on taking action on this. Something else you might want to consider is something like Minimo's small screen rendering; your screen is bigger than a PDA's, but still much smaller than a standard PC display.
Assignee: sharparrow1 → mpgritti

The bug assignee didn't login in Bugzilla in the last 7 months, so the assignee is being reset.

Assignee: mpgritti → nobody
Severity: normal → S3
Attachment #9386509 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: