Closed Bug 374141 Opened 18 years ago Closed 17 years ago

Borders of various form controls are not rendered on print preview

Categories

(Core :: Print Preview, defect, P2)

x86
Windows XP
defect

Tracking

()

VERIFIED FIXED

People

(Reporter: martijn.martijn, Assigned: roc)

References

Details

(Keywords: regression, testcase)

Attachments

(4 files)

Attached file testcase
See testcase. When looking at the testcase in print preview, I don't seen any border of the various form controls. I'm on windowsXP, using the classic theme. This regressed between 2007-02-13 and 2007-02-14: http://bonsai.mozilla.org/cvsquery.cgi?treeid=default&module=all&branch=HEAD&branchtype=match&dir=&file=&filetype=match&who=&whotype=match&sortby=Date&hours=2&date=explicit&mindate=2007-02-13+04&maxdate=2007-02-14+08&cvsroot=%2Fcvsroot I think a regression from bug 369834.
Yeah, actually a regression from bug 177805. It's just that now it affects print preview as well as printing. The issue is simply that theme renderig isn't getting scaled up for printing; therefore, the borders are too thin to be visible. Reassigning to self, but I'm not planning on working on this for a while.
Assignee: printing → sharparrow1
Attached image broken print preview
Not only do the borders not show, but the text is huge and overlapping. I haven't used print preview in a while, so don't know when this happened. My only extensions are Adblock and Paste and Go.
(In reply to comment #3) > Not only do the borders not show, but the text is huge and overlapping. That's bug 372838.
Also, the print output doesn't show any borders on the testcase. This seems serious enough to be blocking 1.9 for me.
Flags: blocking1.9?
Assignee: sharparrow1 → nobody
Eli can you take a look at this since it was a regression from your check-in?
Assignee: nobody → sharparrow1
Flags: blocking1.9? → blocking1.9+
Priority: -- → P3
probably better if I take it
Assignee: sharparrow1 → roc
I tried this out. Some borders are missing at some scale factors (usually when we're shrinking) --- that's just because we snap to pixels when drawing. If you scale up enough the borders are there. I'm in a VM, but if I set up a dummy Postscript printer and use it to generate Postscript, the borders seem to be there too. Martijn, am I missing something? Try scaling print preview up to 200% or 400%? Can you give me a screenshot of your print preview? Or has this been fixed recently?
I tried print previewing to 200%, in that case, the majority of the borders are there. Printing seems to be busted again for me in current trunk build, nothing shows up on the page.
This is what I see on print preview with 200% zoom.
In my test, print DPI is 600 and screen DPI is 96, so print preview scales everything by 0.16. When we zoom by 200%, everything is scaled by 0.32. When we paint a native-themed widget, we paint it just as a large widget scaled down by 0.32 --- so a 1px device-pixel theme border becomes 1/300 of an inch, which is why borders seem thin and often disappear on the screen. One way to fix this would be to make "device pixels" for printing bigger. That's not a great solution, but maybe it's the best available. Actually I'm not sure how we get device pixels that small for printing in the first place, we're supposed to be using 72dpi...
Oh, Windows printing just uses the dpi of the printer. I'll see if I can change the Windows printing DPI to 72.
That requires code changes in multiple places to adjust the surface size, maybe risky. As an alternative, I'm thinking of hacking nsNativeThemeWin to scale theme borders by some amount.
Attached patch fixSplinter Review
This seems to work and it's a small patch, although it feels a little scary.
Attachment #301615 - Flags: review?(pavlov)
Whiteboard: [needs review]
There's a bit of a problem; the device pixel size not only affects theme rendering, but also font metrics and character placement because GDI and Uniscribe return all glyph positions and text measurements in device pixels. So 72dpi isn't good for Windows because character positions get aligned to 72dpi and that makes glyph positioning look chunky. I'd change the print dpi to 144 before checking in ... that will be more forgiving for text but still let native theme pixels be reasonably large. A longer-term fix probably requires us to modify nsNativeThemeWin so that when the device pixel size is different from the screen's device pixel size, we scale all theme drawing and measurement to suit. That would be quite a lot of risky work. We might decide to do that on all platforms, in fact.
Priority: P3 → P2
OK Stuart, you marked this P2, does that mean you're going to review the patch? :-)
Comment on attachment 301615 [details] [diff] [review] fix this patch scares me, but lets go for it.
Attachment #301615 - Flags: review?(pavlov) → review+
checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [needs review]
Depends on: 418428
This looks like it caused bug 418428. I don't have a printer, so I can't confirm the bug, but someone should probably take a look at it since it has a range and a testcase.
Status: RESOLVED → VERIFIED
i cannot verify this bug, because i still see problems with the border rendering on print preview, i filed Bug 432739 for this.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: