Closed Bug 1412687 Opened 7 years ago Closed 4 years ago

[Layout] Prints only first page when nested aligned/floated table is longer than a page

Categories

(Core :: Print Preview, defect, P2)

56 Branch
defect

Tracking

()

RESOLVED FIXED
81 Branch
Tracking Status
firefox-esr68 --- wontfix
firefox-esr78 --- wontfix
firefox79 --- wontfix
firefox80 --- wontfix
firefox81 --- fixed

People

(Reporter: petr.gajdusek, Assigned: TYLin)

References

(Regression)

Details

(Keywords: regression, Whiteboard: [frag2020_v81][layout:backlog], [wptsync upstream])

Attachments

(4 files, 3 obsolete files)

Attached file test.html (obsolete) —
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36

Steps to reproduce:

Open attached test.html which contains a "table td > div > table[align=right]" in FF 56 or 57 beta.
Open print preview.



Actual results:

Only first page of the table (with attribute align=right or style float: right) is printed.

All pages are printed if the table has style="margin: 0 0 0 auto" or if the parent div is omitted.



Expected results:

All pages should be printed as in Firefox 55 and earlier.
Component: Untriaged → Printing: Output
Product: Firefox → Core
Regression should be blocking the regressing bug rather than depending on it.
Blocks: 1308876
No longer depends on: 1308876
This may be a dupe of bug 1406291 I guess.
Priority: -- → P3
Attached file simpler testcase (obsolete) —
There is no need for the print media style sheet. The only relevance of that is that it makes the nested table big enough that it can't fit on a single page. It's simpler to simply add more content to the nested table to trigger the bug.
Attachment #8923205 - Attachment is obsolete: true
Attachment #8943691 - Attachment mime type: text/plain → text/html
Attached file simpler testcase
Attachment #8943691 - Attachment is obsolete: true
Attachment #8943692 - Attachment mime type: text/plain → text/html
Summary: Prints only first page of floating table (or table having align attribute) → [Layout] Prints only first page when nested aligned/floated table is longer than a page
Component: Printing: Output → Print Preview
Keywords: regression
Regressed by: 1308876
No longer regressed by: 1308876
No longer blocks: 1308876
Regressed by: 1308876

This is not fixed by bug 1474771, so it needs further investigation.

Many printing loss issues related to the float elements are because we
don't reflow enough to break the float elements.

nsColumnFrame::ReflowChildren() uses mMustReflowPlaceholders to force
reflow children even if the column block-size is unchanged. It's similar
when we are in a paginated context, where the page size is fixed. We
also want to force reflow children, especially for frames like
nsTableRowGroupFrame that they reflow children in unconstrained
block-size to measure total block-size, and do an incremental reflow in
constrained block-size later.

Use mMustReflowPlaceholders in ShouldReflowAllKids() because we want a
overflow container child to reflow its children (can be floats) again in
nsContainerFrame::ReflowOverflowContainerChildren() even if its not
dirty.

Assignee: nobody → aethanyc
Status: NEW → ASSIGNED

Tracking as potential print output fix for 81.

Priority: P3 → P2
Whiteboard: [frag2020_v81][layout:backlog]

ReflowInputFlags is a struct of bitfields, so we cannot use AutoRestore to
restore its member bitfield.

This patch is similar to Bug 1559961 Part 2 [1]. That is, we want to reflow
an overflow container again if its scrollable overflow block-end exceeds
the available block-size constraint.

[1] https://hg.mozilla.org/mozilla-central/rev/d377ce300d0349c1b7dc562bcf5343851d36c6ed

Depends on D87629

Attachment #9164468 - Attachment is obsolete: true
Pushed by aethanyc@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/9a82bca1962a
Part 1 - Make const-cast clearer in nsTableRowGroupFrame::Reflow(). r=dholbert
https://hg.mozilla.org/integration/autoland/rev/ce14bf5310d1
Part 2 - Consider an overflow container's scrollable overflow when deciding whether to reflow it. r=dholbert
https://hg.mozilla.org/integration/autoland/rev/fc7ac8859238
Part 3 - Add a reftest testing breaking a float in a table. r=dholbert
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/25160 for changes under testing/web-platform/tests
Whiteboard: [frag2020_v81][layout:backlog] → [frag2020_v81][layout:backlog], [wptsync upstream]
Upstream PR merged by moz-wptsync-bot
Has Regression Range: --- → yes
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: