Closed Bug 361844 Opened 16 years ago Closed 16 years ago

Printing cleanup


(Core :: Printing: Output, defect)

Windows XP
Not set





(Reporter: sharparrow1, Assigned: sharparrow1)




(2 files)

Patch coming up shortly.


1. Less interdependence between nsPrintEngine and nsDocumentViewer.  nsPrintEngine now manages its own presentation/destroys its own presentation.  This has the side-effect of making exiting print preview faster than it used to be in the common case of a page with no frames or plugins.  Also, the EndObservingDocument call is now always near the Destroy call for presshells.

2. Allow subdocuments without display presshells to get printed.  There actually wasn't any fundamental reason they weren't working before; it's just that the nsPrintObject code to get the document failed when there wasn't a presshell.

3. Minor bugfix to allow the print preview navigation buttons to work while printing.  Caused by an odd check in PrintPreviewNavigate().

4. Extremely minor bug with printing selection when the HTML body tag isn't at the origin of the document (not normally visible because the body is almost always at the origin). The bug was actually caused by extra code which incorrectly attempted to compensate for the location of the body relative to its parent.

5. Getting rid of extra/duplicate member variables.

6. Getting rid of useless method parameters.

7. Other misc cleanup.
Attached patch PatchSplinter Review
Attachment #246577 - Flags: review?(roc)
Comment on attachment 246577 [details] [diff] [review]

Sure would be nice if GetDisplayTitleAndURL and GetDocumentTitleAndURL etc used string classes instead of malloc'd character pointers!

This is a bit of a rubber-stamp because really you're the only person who knows this code. At some stage --- maybe when you're "done" with fixing this up --- it would be really really great if you could write some documentation for the print engine.
Attachment #246577 - Flags: superreview+
Attachment #246577 - Flags: review?(roc)
Attachment #246577 - Flags: review+
I think I'm going to try and figure out why exactly this fixes bug 361941 before I check this in; I'm worried there might be some deeper event problems.
Attached patch Updated to trunkSplinter Review
I'm going to check this in now.

I decided that for the moment the event stuff is not a big deal; the only thing it breaks is using the arrow keys to scroll the document in print preview, as far as I can tell, so I'm not going to worry about it for the moment.  I'll make sure to keep the printing stuff moving so that it gets fixed in the near future.
Closed: 16 years ago
Resolution: --- → FIXED
Depends on: 363770
Depends on: 365003
Depends on: 365578
Depends on: 363265
Depends on: 372248
Blocks: 361941
Depends on: 398269
(In reply to comment #3)
> I think I'm going to try and figure out why exactly this fixes bug 361941
> before I check this in; I'm worried there might be some deeper event problems.

You need to log in before you can comment on or make changes to this bug.