Closed Bug 407080 Opened 15 years ago Closed 15 years ago

Print preview can happen while the page is loading


(Core :: Print Preview, defect, P2)






(Reporter: martijn.martijn, Assigned: dholbert)




(Keywords: regression)


(1 file, 2 obsolete files)

Normally you get a dialog that says that the page is loading, you can't do print preview right now.
But in current trunk build that's not happening anymore, and you can do print preview while the page is loading.

That seems nice, but it has the bad effect that after closing print preview the page doesn't show up.

I haven't looked for a regression range yet.
Flags: blocking1.9?
This regressed between 2007-02-22 and 2007-02-23:
This is a regression from bug 370966.

The patch in that bug removed the NS_ERROR_GFX_PRINTER_DOC_IS_BUSY_PP error that apparently handled this.

Apparently, it is possible to print while a page is loading (even on branch), so I'm removing that part from the summary.
Blocks: 370966
Summary: Print preview (and probably print too) can happen while the page is loading → Print preview can happen while the page is loading
+'ing.  P5.
Flags: blocking1.9? → blocking1.9+
Priority: -- → P5
Assignee: nobody → dholbert
Attached patch patch v1 (obsolete) — Splinter Review
This patch just re-adds a chunk of nsPrintEngine::PrintPreview that was removed in bug 370966 (during the mergin of Print/ Print-Preview code.)

From doing some preliminary testing, it seems to work as expected.
(In reply to comment #3)
> in bug 370966 (during the mergin of Print/ Print-Preview code.)

OS: Windows XP → All
Hardware: PC → All
Flags: tracking1.9+ → blocking1.9+
Priority: P5 → P2
Attached patch patch v2 (improved comments) (obsolete) — Splinter Review
Attachment #306415 - Flags: superreview?(roc)
Attachment #306415 - Flags: review?(roc)
For reference, this code comes straight from nsPrintEngine::PrintPreview, just before the landing of bug 370966's patch.
(line 761 - 775)
Attachment #306415 - Flags: superreview?(roc)
Attachment #306415 - Flags: superreview+
Attachment #306415 - Flags: review?(roc)
Attachment #306415 - Flags: review+
patch v2 landed

Checking in nsPrintEngine.cpp;
/cvsroot/mozilla/layout/printing/nsPrintEngine.cpp,v  <--  nsPrintEngine.cpp
new revision: 1.165; previous revision: 1.164
Closed: 15 years ago
Resolution: --- → FIXED
This busted mochitests.  test_bug396024.html invokes print preview and triggers the dialog here.
D'oh -- thanks for the heads-up.  Backed out, & will investigate.  (I'm guessing that the mochitest box just isn't giving the page enough time to load before calling PrintPreview on it.)
Reopening until I can re-land with mochitest fix.
Resolution: FIXED → ---
Attachment #306342 - Attachment is obsolete: true
Which machine was busted? Afaik, there is no printer installed on any of the tinderboxes, see bug 406063, so it shouldn't be able to fail on that.
However, test_bug396024.html will indeed fail when you have printers installed with this patch. But I think the test is flawed here. It needs to be rewritten.
I'm pretty sure that both of these were broken:
   Linux qm-centos5-01 dep unit test
   MacOSX Darwin 8.8.4 qm-xserve01 dep unit test

Not 100% sure about the mac, though.
This was busted on the FF Linux box and also my own box.  There's always a print-to-file printer available on Linux (postscript and now PDF).  The FF linux log is at
Patch as-landed, with broken mochitest disabled, per conversation with Martijn and roc on IRC.  (Martijn's going to fix the mochitest at some point.)

Checking in base/tests/;
/cvsroot/mozilla/layout/base/tests/,v  <--
new revision: 1.60; previous revision: 1.59
Checking in printing/nsPrintEngine.cpp;
/cvsroot/mozilla/layout/printing/nsPrintEngine.cpp,v  <--  nsPrintEngine.cpp
new revision: 1.167; previous revision: 1.166
Attachment #306415 - Attachment is obsolete: true
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
Blocks: 396024
Ok, thanks, verified fixed in current trunk build.
I still find it sort of odd that you can print while the page is loading, but I'm not really sure if you can call it a bug or not.

But I think those printer error dialogs can be really annoying and if someone would want to make an automated testcase for this bug, then you would need a way to disable those error dialogs, so I filed bug 422949 for it.

Btw, I have fixed the broken mochitest from bug 396024 now.
(In reply to comment #16)
> Btw, I have fixed the broken mochitest from bug 396024 now.
You need to log in before you can comment on or make changes to this bug.