Open Bug 775617 Opened 13 years ago Updated 3 months ago

Implement page-break-before/page-break-after: avoid

Categories

(Core :: Layout, task)

task

Tracking

()

People

(Reporter: fantasai.bugs, Unassigned)

References

(Blocks 2 open bugs, )

Details

(Keywords: dev-doc-needed, DevAdvocacy, Whiteboard: [DevRel:P3])

Attachments

(3 files)

Breaking this subset out from bug 132035 as a separate bug. Scope is break-before: avoid | avoid-column | avoid-page; break-after: avoid | avoid-column | avoid-page; See http://www.w3.org/TR/css3-multicol/#column-breaks and http://www.w3.org/TR/css3-break/#break-properties
Blocks: css-break-3
Keywords: DevAdvocacy
Whiteboard: [DevRel:P2]
Whiteboard: [DevRel:P2] → [DevRel:P3]
Type: defect → task
Severity: normal → S3
Duplicate of this bug: 1779887

I think this has been overlooked for lack of someone explaining it very simply, and the MDN documentation on version compatibility being wrong for some time. It states that break-after: avoid; is supported since 72 which it was not (I didn't even see a specific mention in the patch notes for that version that says it was being supported).

I contributed separately on the Github Issue but it seems to have been looked over here too, so I'm happy to contribute some of the detail.

In the above posts I attached a test case document and screenshots that show the difference between the intended behaviour of break-after: avoid; in Chromium, versus how the behaviour occurs in Firefox.

You can see that the title 'The Sandy Dunes of the Sahara' in Chromium is pushed to the next page in the print preview, which is the behaviour you expect from break-after:avoid;, it doesn't let a page break come after the element. On Firefox by contrast you can see it has no effect at all. I chose an A4 page layout for this test document.

If you get a different result, make sure you are adding text to the paragraph above the H2 element sufficiently to force the heading to sit right before the page break in print preview. Remember that the correct behaviour is that the H2 element should never be the last element on the page, it should move down to join the paragraph below, or some text should remain under it on the previous page.

Can we set this bug to confirmed now?

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: