Closed Bug 122048 Opened 23 years ago Closed 22 years ago

[FIX]Print preview on screen with applets hangs on Reload/Back

Categories

(Core :: Print Preview, defect)

x86
Windows 2000
defect
Not set
critical

Tracking

()

VERIFIED FIXED
mozilla1.0

People

(Reporter: DomIncollingo, Assigned: rods)

References

()

Details

(Keywords: hang, Whiteboard: [adt1] verify 127969 also.)

Attachments

(3 files, 4 obsolete files)

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.7+)
Gecko/20020125
BuildID:    2002012503

When print preview is performed on (certain) pages with applets, Mozilla hangs
when the Reload or Back button is chosen to return to return to normal (not
Print Preview) mode.

Reproducible: Always
Steps to Reproduce:
1.Navigate to http://java.sun.com/ or http://www.visitor.calgary.ab.ca/.  Both
sites use applets.
2.Choose Print Preview.
3.Following Print Preview, choose the Reload button to display the original
screen image.

Actual Results:  The browser hangs when the Reload button is pressed.  The
screen image does not return to its original (not Print Preview) display.  In
addition, I can not navigate to any other pages, either by entering the URL or
selecting a bookmark.  

Windows Task Manager indicates that Mozilla is 'Running' (rather than 'Not
Responding'), but I waited for three minutes and Mozilla continued to hang for
this entire time.  (I cancelled Mozilla from Task Manager after three minutes.)

Note that if you naviate to one of these two URLs, choose Print Preview, and
then choose the Back button (instead of Reload), the same result occurs: the
browser hangs.

Expected Results:  If the Reload button is chosen, the screen image should
refresh to its original (prior to Print Preview) display.  If the Back button is
chosen, the browser should display the prior page.  The browser should not hang.

Running Mozilla on Win 2K with 512 MB of RAM.
Note that Task Manager indicates that Mozilla is 'Running', but Mozilla hung
and remaind in Print Preview mode for 3 minutes.
Same comment as for first attachment.
Confirming on Windows 98, Build ID: 2002020103, Java 2 Runtime Environment,
Standard Edition (build 1.3.1_01). Language: English/US.

After the hang, I could exit Mozilla. The browser window closed. But, the
Ctrl-Alt-Del task list still listed Mozilla. I had to cancel the task manually.

Adding keyword "hang."
Keywords: hang
Really confirming.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.9
Target Milestone: mozilla0.9.9 → mozilla1.0
It hangs using 2002022003 build when closing the print preview window after
print previewing http://java.sun.com/.

Marking nsbeta1+. 

Severity: normal → critical
Keywords: nsbeta1+
Changing component from printing to print preview.
Component: Printing → Print Preview
*** Bug 127606 has been marked as a duplicate of this bug. ***
Attached patch patch (obsolete) — Splinter Review
This patch enables use to cache the current presentation and then restore it
when exiting PP.

It also fixes nsObjectFrame::Paint to paint the plugin in the right place.
Summary: Print preview on screen with applets hangs on Reload/Back → [FIX]Print preview on screen with applets hangs on Reload/Back
Attached patch full patch (obsolete) — Splinter Review
includes changes from previous patch plsu this adds the pref
"print.always_cache_old_pres" to all.js
Attachment #74081 - Attachment is obsolete: true
*** Bug 113317 has been marked as a duplicate of this bug. ***
Attached patch full patch (obsolete) — Splinter Review
Full patch and it now includes code for UNIX plugins to paint an empty rect
when in PP.
Attachment #74723 - Attachment is obsolete: true
Blocks: 108509
Attached patch patch (obsolete) — Splinter Review
Full patch, but changed so that plugins don't paint at all in Print Preview.
This is needs an entirely different fix that is more involved than we have time
for.
Attachment #75008 - Attachment is obsolete: true
adt1 per adt triage
Whiteboard: [adt1]
Attached patch patchSplinter Review
Generically enables the browser to cache the curent presentation (frames,
views, et.al.) for Print Preview and then enables them to be restored.

It uses a pref and/or checks all the documents to see if any have an "embed" or
a "plugin". Temporarily it checks for framesets and turns on caching also.

I also factored some code in the Init routine so it could be callled for either
creating the new presention or initializing an existing one.

Also, added some safety check code in PrintPage.

Then for the object frame, for PP it doesn't do a paint - this is a temporary
fix.
Attachment #75408 - Attachment is obsolete: true
Comment on attachment 75585 [details] [diff] [review]
patch

r=peterl, no more hang
Attachment #75585 - Flags: review+
Comment on attachment 75585 [details] [diff] [review]
patch

I like the general idea of the patch, and the code looks good, but I really
dislike that the caching is tied tightly to Print Preview. This should be a
general facility - maybe Print Preview is the only place it is used for a
while, but I cannot think of any good reason to tie it to Print Preview and as
a result prevent other uses of it (an example that comes to mind is caching the
presentation of the previous page in case the user hits back - or storing the
presentation for the last 'n' pages, tied to the history - or something).

Can we generalize it a tad and not make it a PrintPreview only feature? Or am I
over generalizing here?
The general case could be a new feature, but at the moment PP is the only one
where there is a requirement. Plus, very soon we want to move Plugins over to
content anway...
Comment on attachment 75585 [details] [diff] [review]
patch

I am a little concerned that DocumentViewer is getting too entangled in Print
Preview-specific stuff. However, I think the gravity of the bug outweighs my
immediate concern for code purity, sr=attinasi

One note: the CachedPresentation data member in the PrintObject could easily be
an object instance instead of a pointer, as the COMPtr's in it can be set and
null'd easily - you would just need a 'clear' method on it to use instead of
deleting it. This would avoid having to allocate it and free it.
Attachment #75585 - Flags: superreview+
Since the CachedPresentationObj gets handed off from PrintData object to the
next PrintData object it is much handier to have it be a pointer. 

Ready for approval.
Keywords: approval, review
*** Bug 133029 has been marked as a duplicate of this bug. ***
*** Bug 127969 has been marked as a duplicate of this bug. ***
No longer blocks: 108509
*** Bug 108509 has been marked as a duplicate of this bug. ***
*** Bug 131616 has been marked as a duplicate of this bug. ***
Whiteboard: [adt1] → [adt1] verify 127969 also.
Comment on attachment 75585 [details] [diff] [review]
patch

a=asa (on behalf of drivers) for checkin to the 1.0 trunk
Attachment #75585 - Flags: approval+
fixed
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
I'd be interested in seeing a bug about making this
facility a bit more generic and using it elsewhere.
Do you fancy filing one, Marc?
verified in 3/27 build.

REOPEN if this is not fixed for anyone...
Status: RESOLVED → VERIFIED
this problem is gone now...

however, now I see another problem:

in PP mode, should applets render? I"m getting different results on
different platforms. On windows, I don't see the applet in PP mode.
On Mac, I do see it, but it is shifted over a bit...filing a bug

Also Peter wanted me to see how plugins behave in PP mode...might
file a bug on that also if I see a problem.
http://bugzilla.mozilla.org/show_bug.cgi?id=133992

filed this bug on applets rendering inconsistently in PP mode
if anyone is interested in cc:'ing themselves on that bug...
Plugins should not render at all in PP because we can't do it correctly at this
time.

The Mac has a bug in that the orriginal applet from the page is never hidden
(hiding parent widget doesn't hide plugin's) and therefore shows up in PP, in
the wrong location. Let's use bug 133992 to fix that isssue and open a new bug
to implement PP for plugins for post mozilla 1.0.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: