Closed
Bug 332927
Opened 19 years ago
Closed 19 years ago
Clean up iframe/frame printing code
Categories
(Core :: Printing: Output, defect)
Core
Printing: Output
Tracking
()
RESOLVED
FIXED
People
(Reporter: sharparrow1, Assigned: sharparrow1)
References
Details
Attachments
(1 file, 3 obsolete files)
88.29 KB,
patch
|
roc
:
review+
roc
:
superreview+
|
Details | Diff | Splinter Review |
This patch implements a bunch of cleanups for printing iframes: not using page sequences for subdocuments on a page, hooking subdocuments into the parent document in both print and print preview, and hooking subdocuments into the parent document's view tree. Also some other misc code cleanup. Note that this changes the code to create scrollframes for subdocuments in print preview; not doing that led to clipping problems.
Blocks 332806 because the fix for that is in this patch; mPresContext wasn't always a valid pointer. It was always rather confusing, and unneeded, so I got rid of it.
Patch coming up.
Assignee | ||
Comment 1•19 years ago
|
||
Attachment #217370 -
Flags: review?(roc)
Just as an aside, do you know why we need nsPageFrame's child (nsPageContentFrame?) to have a widget?
Assignee | ||
Comment 3•19 years ago
|
||
I just tried it; I guess my changes make it possible. I'll get rid of it. New patch coming up soon.
Assignee | ||
Comment 4•19 years ago
|
||
By the way, this patch makes it so that iframes can be scrolled in print preview; do you think that's fine?
Attachment #217370 -
Attachment is obsolete: true
Attachment #217654 -
Flags: review?(roc)
Attachment #217370 -
Flags: review?(roc)
I think we don't want anything to be scrollable in print preview. Should be easy to fix that.
Assignee | ||
Comment 6•19 years ago
|
||
Okay, I think this takes care of all the issues.
Attachment #217654 -
Attachment is obsolete: true
Attachment #217709 -
Flags: review?(roc)
Attachment #217654 -
Flags: review?(roc)
Assignee | ||
Comment 7•19 years ago
|
||
Sorry about all the patches; apparently not having BeginObservingDocument and EndObservingDocument around the initial reflow causes problems for textareas.
Attachment #217709 -
Attachment is obsolete: true
Attachment #217746 -
Flags: review?(roc)
Attachment #217709 -
Flags: review?(roc)
Comment on attachment 217746 [details] [diff] [review]
Patch v4
+ if (aPO->mParent->mPresShell) {
+ frame = aPO->mParent->mPresShell->FrameManager()->
+ GetPrimaryFrameFor(aPO->mContent);
+ }
It would be better to call nsLayoutUtils::GetCrossDocParentFrame on aPO's root frame, then things won't break if we ever allow subdocuments to break.
Why do we need ReflowDocList? Can't we reflow child documents through nsSubDocumentFrame::Reflow like we normally do? If the answer is "yes", don't bother putting it in this patch, just land this and do another patch.
Attachment #217746 -
Flags: superreview+
Attachment #217746 -
Flags: review?(roc)
Attachment #217746 -
Flags: review+
Assignee | ||
Comment 9•19 years ago
|
||
(In reply to comment #8)
> (From update of attachment 217746 [details] [diff] [review] [edit])
> + if (aPO->mParent->mPresShell) {
> + frame = aPO->mParent->mPresShell->FrameManager()->
> + GetPrimaryFrameFor(aPO->mContent);
> + }
>
> It would be better to call nsLayoutUtils::GetCrossDocParentFrame on aPO's root
> frame, then things won't break if we ever allow subdocuments to break.
That's not really doable. At this point, the subdocument has no frames; that content object is obtained by going through the parent document's content tree. What do you mean by allowing subdocuments to break? The approach is already pretty broken. For example, it will completely miss anonymous content, because it's not in the content tree. Anyway, the worst that can happen is that the subdocument won't print. This will all go away after we get rid of ReflowDocList (see below).
> Why do we need ReflowDocList? Can't we reflow child documents through
> nsSubDocumentFrame::Reflow like we normally do? If the answer is "yes", don't
> bother putting it in this patch, just land this and do another patch.
Yes, but it's not a simple patch; one thing that requires new code is the separated frames case, which currently requires the frames to be reflowed and printed separately. I'm not exactly sure how that will work, but we'll figure it out. I'll file a bug on that.
Also, on a side note, how do we clone a document with subdocuments? I don't really understand how docshells work.
Sounds reasonable.
Yes, cloning a document with subdocuments is going to be tricky. The docshell/contentviewer/globalwindow mess is nasty. We'll need to create a new docshell as normal and then instead of loading a document, we give it a recursively cloned document.
Assignee | ||
Comment 11•19 years ago
|
||
Checked in.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Comment 12•19 years ago
|
||
Could this have caused bug 333590?
Updated•19 years ago
|
You need to log in
before you can comment on or make changes to this bug.
Description
•