Closed Bug 383195 Opened 18 years ago Closed 17 years ago

Repeatable footers don't work on trunk in Print/Print-Preview

Categories

(Core :: Layout: Tables, defect, P2)

x86
All
defect

Tracking

()

RESOLVED FIXED

People

(Reporter: bzbarsky, Assigned: roc)

References

()

Details

(Keywords: regression, Whiteboard: [dbaron-1.9:RwCr])

Attachments

(2 files)

The testcase in the URL bar fails on trunk. It seems to work as of right before 1.8 branched. I have no idea when it broke; I tried to find a range, but printing seems to have been completely busted on trunk for most of 2006. Or at least the nightly builds I have from that time don't even paginate this testcase in print preview, and don't print it when I try to print to file. Someone who's not on Linux might want to look into this, in the hope that things are better elsewhere.
Flags: blocking1.9?
Blocks: 383196
Martijn, I suspect this is mine, do you have time to find a regression range?
Thanks for finding the regression range, dophinling. This doesn't seem to be a problem on branch. However, on print preview, when I change to Landscape format, I don't get a footer on the second page. I can see that problem even on branch. I guess I should file a new bug on that?
>This doesn't seem to be a problem on branch. This rules out bug 362708 as it landed on the branches.
Flags: blocking1.9? → blocking1.9+
Summary: Repeatable footers don't work on trunk → Repeatable footers don't work on trunk in Print/Print-Preview
During Print-Preview, I'm just seeing one footer (on the last page) on trunk builds for *both* Windows and Linux. (This is instead of one footer per page, which would be correct.) Marking as OS: All.
OS: Linux → All
(In reply to comment #3) > when I change to Landscape format, I don't get a > footer on the second page. I can see that problem even on branch. I guess I > should file a new bug on that? Filed bug 389748 for this separate branch issue.
Blocks: 389668
David do you remember why you removed the footer frame stuff?
I had a discussion with bz on IRC (#developers) The agreement was that the removed code needs to be reimplemented but the reflow state should not be used to keep track of the necessary pointers and sizes. Local variables should be used instead.
Whiteboard: [dbaron-1.9:RwCr]
I'll take this since we should do it soon, there will probably be regressions or other followup work.
Assignee: nobody → roc
nsTableFrame::Reflow contains if (isPaginated && !GetPrevInFlow() && (NS_UNCONSTRAINEDSIZE == aReflowState.availSize.height)) { nscoord height = presContext->GetPageSize().height; // don't repeat the thead or tfoot unless it is < 25% of the page height if (thead && height != NS_UNCONSTRAINEDSIZE) { thead->SetRepeatable(IsRepeatable(*thead, height)); } if (tfoot && height != NS_UNCONSTRAINEDSIZE) { tfoot->SetRepeatable(IsRepeatable(*tfoot, height)); } } I can't figure out how this ever got executed. When did we do an unconstrained-height reflow with pagination enabled? I thought perhaps nsTableFrame::Reflow did an extra unconstrainted-height reflow to make this happen, but I can't find any such thing in the pre-reflow-branch-landing code.
aReflowState is not an nsHTMLReflowState there. It's a nsTableReflowState. See http://bonsai.mozilla.org/cvsblame.cgi?file=/mozilla/layout/tables/nsTableFrame.cpp&rev=3.616.6.12&mark=1937-1940,1944-1946#1924 for the place this reflow is coming from.
Attached patch patch v1Splinter Review
My first go at getting this working. The approach is a bit different from what we used to do. I'm reflowing headers and footers at the start of ReflowChildren to determine whether we should repeat them, and if a footer should be repeated, how much height it needs. Seems to work OK in my limited testing. I'm assuming that reflowing them "out of order" is OK, if suboptimal, because we reorder rowgroups etc anyway. The risky part here I think is that we reflow with unconstrained height and then reflow again with constrained height. I wonder if there's something I need to do to make sure the second reflow happens correctly.
Attachment #287499 - Flags: review?(bernd_mozilla)
Whiteboard: [dbaron-1.9:RwCr] → [dbaron-1.9:RwCr][needs review]
The special-height reflow stuff does an unconstrained height reflow followed by a constrained height reflow, for the entire table, which suggests what I'm doing should be OK.
Moving this to P2, but there's no reason why we won't take this during beta 2. We will accept this if the patch is ready.
Priority: P1 → P2
Comment on attachment 287499 [details] [diff] [review] patch v1 > // XXXroc shouldn't we add a repeated footer here? I think yes, it would otherwise not create a footer for a table where every row is encapsulated in a row group or at least the row that does not fit, is such a encapsulated row.
Attachment #287499 - Flags: review?(bernd_mozilla) → review+
Comment on attachment 287499 [details] [diff] [review] patch v1 I'll file a followup bug about repeating a footer in that case, rather than fix it here now.
Attachment #287499 - Flags: superreview?(dbaron)
Whiteboard: [dbaron-1.9:RwCr][needs review] → [dbaron-1.9:RwCr][needs sr dbaron]
Comment on attachment 287499 [details] [diff] [review] patch v1 sr=dbaron, although I suspect isPaginated isn't really the right test and we'll eventually want to do this for multi-column as well.
Attachment #287499 - Flags: superreview?(dbaron) → superreview+
Getting this to work in dynamic contexts is a really big nasty project. I don't know when if ever we'll get around to doing that with our current continuation architecture.
checked in
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Whiteboard: [dbaron-1.9:RwCr][needs sr dbaron] → [dbaron-1.9:RwCr]
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: