Closed Bug 191875 Opened 22 years ago Closed 22 years ago

Print preview scrollbars are missing/busted

Categories

(Core :: Print Preview, defect)

defect
Not set
major

Tracking

()

RESOLVED DUPLICATE of bug 191938

People

(Reporter: durbacher, Assigned: bzbarsky)

References

()

Details

(Keywords: regression)

Attachments

(3 files, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030202
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.3b) Gecko/20030202

In both Classic and Modern the print preview scrollbars are not painted
correctly. They still work, though, if you can guess where their elements are.

This regressed between 2003012908 and 2003020204. (both with the same fresh profile)
Bug 191574 was fixed during that time and was about print preview, but I don't
think it looks like the cause...

On IRC I was told this also is busted on Linux in Phoenix "since two days",
biesi did not see it on Linux in a Mozilla CVS build - but I don't know the
exact date of it. So I'm not sure if it is all/all...

Reproducible: Always

Steps to Reproduce:
1. Load a page (long enough to require a scrollbar in print preview, mozilla.org
should suffice)
2. Go to "File - Print Preview"

Actual Results:  
Scrollbar(s) is/are painted black in classic, in modern their border is painted
correctly, but the interior is gray.

Expected Results:  
Scrollbars should look like scrollbars.

I hope the component is correct. It's frontend stuff, but AFAIK it's only broken
in print preview, so...
Screenshot
Also textareas get a black background color and dropdowns are not visible...
Looks pretty broken
Severity: normal → major
Keywords: regression
Can somebody try this with builds between 2003012908 and 2003020204?
Unfortunately there is no Windows build in this timeframe...
So that also might confirm the bug on other platforms.
Does this happen on todays Linux builds?

What José found made me think this should maybe block 1.3b.

Is the printed page also affected or only the preview?
I don't have a printer right now...

cc'ing biesi: please tell the date of your CVS build where you could not
reproduce this. Thanks!
Nominating for Buffy, nsbeta1
Keywords: nsbeta1
Nominating as 1.3b blocker:
very recent (3-4 days) regression that makes print preview (and maybe printing)
quite ugly. I don't think you want to give people a Mozilla like this.
Flags: blocking1.3b?
I am seeing the same issue in 2003-02-03-08-trunk Solaris2.7/SPARC nightly
build.
OS: Windows 2000 → All
Hardware: PC → All
Bug 191574 is totally the cause of this, and backing it out fixes the scrollbar
appearance.
Ugh. Some XUL frames use PaintSelf....  Proposed fix coming up.
Assignee: rods → bzbarsky
Attached patch This fixes most of it (obsolete) — Splinter Review
That fixes scrollbars, textareas, dropdowns.  It does _not_ fix <select
size="n"> for n > 1.
roc, any ideas as to what's up with the listbox?  It's just painting garbage
here.  If I make the block inside paint its background (which looks like it
should be transparent, btw) then things are fine.   In the case when the block
is not painting, nothing really paints a background in that rect (the
scrollframe does not, and the nsFrame method that gets called does not paint a
background either).

Shouldn't the view just fall back on being transparent in that case instead of
showing garbage as the background?
Maybe views are being treated as opaque that are no longer opaque because the
use of the print setting is preventing the background from being painted?
Yeah. If a frame decides not to honour it's 'background-color' setting, it MUST
return PR_FALSE from CanPaintBackground.

This may mean you have to pass a prescontext into CanPaintBackground to give you
enough info to make the decision. That would be a fine change IMHO.
OK, this does fix the most serious problems, but I do not like it one bit. 
With this change, markup like:

<div style="position:absolute; top:0">
aaaaaaaaaaaa
</div>
<div style="position:absolute; top:0; background: red">
bbbbbbb
</div>

paints in an undesirable way.  In the current code, the background will _not_
be painted, but the "aaaaaa" under the "bbbbbbb" will also not be visible.... 
With this patch both sets of text are painted, naturally.  I've filed bug
191938 on that....
Attachment #113528 - Attachment is obsolete: true
Also elements with position fixed have black background, see Viewer Demos #12 in
Print Preview
Comment on attachment 113545 [details] [diff] [review]
yeah, this works....

Yeah, the patch fixes that.
Attachment #113545 - Flags: superreview?(roc+moz)
Attachment #113545 - Flags: review?(roc+moz)
Robert O'Callahan, can you do the review?

I'm really sorry for bugging you in such an inappropriate way, but I think this
is important for 1.3b if you don't want to ship a print preview that never works
right on any platform. 
Drivers have still not decided if it is blocking or not, so I just want to
prevent that this is forgotten about...
Thanks...
"never works right"?

This is only a problem if background printing is turned off.  (Granted, that is
the default setting.)
I think a better fix for this is to use the approach in bug 191938.
Depends on: 191938
Re comment #18:
Sorry, bz, technically I was wrong. 
But with regards to the zintillions of 1.3b downloaders who rarely change any
defaults it is correct. 
And that counts when deciding if this bug should block 1.3b.
Attachment #113545 - Flags: superreview?(roc+moz)
Attachment #113545 - Flags: review?(roc+moz)

*** This bug has been marked as a duplicate of 191938 ***
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → DUPLICATE
Clearing 'blocking1.3b' request because bug is duped.

(The other bug is not mine and I'm not sure everybody considers the problem
important, so I leave re-requesting there to others...)
Flags: blocking1.3b?
bzbarsky: just in theory, would it have been a good idea to use this patch here
for the 1.3 release to just fix the visual problem (while the one in bug 191938
was the better one for the trunk in long-term) if someone had thought of it a
month (sic!) earlier?
Compared to the rewrite in the other bug the changes here are minor and look
quite unrisky to my untrained eye (for a fix that would have weeks to prove to
be good).
See comment 14.

The simple fix for 1.3 would perhaps be a backout of bug 191574.  If someone
wants to pitch that to drivers, go for it.
We could just use the patch I used. It has baked on the trunk for a while now.
And more dups are getting filed than I expected.
Fix checked into 1.3 branch after drivers discussion.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: