Bug 695939

Summary: page breaks ignored in ePub CSS
Product: MuPDF Reporter: Pablo Rodríguez <ghostscript>
Component: epubAssignee: MuPDF bugs <mupdf-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: tor.andersson
Priority: P4    
Version: master   
Hardware: Other   
OS: All   
Customer: Word Size: ---
Bug Depends on:    
Bug Blocks: 695935    

Description Pablo Rodríguez 2015-04-18 05:14:32 UTC
There are three page break properties in CSS: 'page-break-before', 'page-break-after' and 'page-break-inside' (http://www.w3.org/TR/CSS2/page.html#page-break-props).

'page-break-inside' only allows two values: auto (do nothing) or avoid (page breaks inside the element box).

'page-break-before' and 'page-break-after' allow more values:

    auto: neither force or forbid pagebreaks.

    always: force page breaks

    avoid: forbid page breaks

left and right are othe possible values, but they may be interpreted as always. I think this makes sense displaying ePub files.

Well, I’ afraid that mupdf-1.7 ignores any page break related property.

The parent issue (which is blocked by this one) contains the following code:

    .hidden>p {
        page-break-before: always;
        }

In the second page of the ePub file attached to the parent issue (the one being blocked by this issue and with the heading “Hidden Title”) each paragraph should have a page break before and it doesn’t.
Comment 1 Tor Andersson 2016-04-26 05:46:00 UTC
Fixed in commit 19282ec51201d749d7cbaed4cf76af54a467993e
Author: Tor Andersson <tor.andersson@artifex.com>
Date:   Mon Apr 11 16:58:20 2016 +0200

    epub: Support page-break-before/after: always, left and right.
    
    Does not support page-break-before/after: avoid.

Supporting 'avoid' is going to be much more difficult, and may need some architectural restructuring that won't happen until after we have added support for floats and tables.