Open Bug 1152768 Opened 9 years ago Updated 2 years ago

When printed, elements with page-break-inside:avoid are pushed to the next page even when they will be page-broken there too


(Core :: Printing: Output, defect)

37 Branch
Windows 7





(Reporter: stokesified, Unassigned)


(Keywords: testcase)


(3 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:37.0) Gecko/20100101 Firefox/37.0
Build ID: 20150402191859

Steps to reproduce:

When using elements with the page-break-inside:avoid style, elements on the page are sometimes moved to the next printed page because they would not fit on the current page without being broken.  However, if the element is bigger than an entire page, moving it to the next page does not prevent it from being broken, therefore it should not be moved.

This is demonstrated in the attached HTML test, when printed (or previewed) on 8.5"x11" paper with a standard portrait orientation.

Actual results:

Elements with this style get moved to the next page when they won't fit on the current page, even if that action will not 'avoid' them being broken.  This can result in 'choppy' print output that uses more pages than the content requires.

Expected results:

An element with the page-break-inside:avoid should only be moved to a new page when doing so will _avoid_ a page break inside that element.  If the element will be broken on the next page anyway, there's no advantage to moving it.
8.5"x11", is it called US Letter?
In addition, could you attach the result of the printing (pdf or xps file eg), please.
Component: Untriaged → Printing: Output
Product: Firefox → Core
Flags: needinfo?(stokesified)
Flags: needinfo?(stokesified)
Yes, I meant US Letter.  I'm sure the problem will surface for any page size, but my HTML example is meant to demonstrate on US Letter size.
Keywords: testcase
I can confirm this issue with Din-A4 (210 mm X 297 mm) portrait as well.
I will attach a testcase for that as well.
Attached file TestCase for DinA4.
Either: "ONE" then "TWO" pagebreak then "A" followed by "B"
Or: "ONE" pagebreak "TWO" "A" pagebreak "B"

"ONE" pagebreak "TWO" pagebreak "A" "B"
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.