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

UNCONFIRMED
Unassigned

Status

()

UNCONFIRMED
4 years ago
3 years ago

People

(Reporter: stokesified, Unassigned)

Tracking

({testcase})

37 Branch
x86_64
Windows 7
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(3 attachments)

(Reporter)

Description

4 years ago
Created attachment 8590253 [details]
HTML demonstrating the problem when previewed for 8.5"x11" paper, portrait orientation

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.

Comment 1

4 years ago
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

Updated

4 years ago
Flags: needinfo?(stokesified)
(Reporter)

Comment 2

4 years ago
Created attachment 8593710 [details]
PDF of printed content, Letter (8.5"x11"), Portrait
Flags: needinfo?(stokesified)
(Reporter)

Comment 3

4 years ago
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.

Updated

4 years ago
Keywords: testcase

Comment 4

3 years ago
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.

Comment 5

3 years ago
Created attachment 8670144 [details]
TestCase for DinA4.

[Expected]
Either: "ONE" then "TWO" pagebreak then "A" followed by "B"
Or: "ONE" pagebreak "TWO" "A" pagebreak "B"

[Observation]
"ONE" pagebreak "TWO" pagebreak "A" "B"
You need to log in before you can comment on or make changes to this bug.