Dompdf\FrameDecorator\Page::_page_break_allowed
Determine if a page break is allowed before $frame http://www.w3.org/TR/CSS21/page.html#allowed-page-breaks
In the normal flow, page breaks can occur at the following places: 1. In the vertical margin between block boxes. When a page break occurs here, the used values of the relevant 'margin-top' and 'margin-bottom' properties are set to '0'. 2. Between line boxes inside a block box. These breaks are subject to the following rules: * Rule A: Breaking at (1) is allowed only if the 'page-break-after' and 'page-break-before' properties of all the elements generating boxes that meet at this margin allow it, which is when at least one of them has the value 'always', 'left', or 'right', or when all of them are 'auto'. * Rule B: However, if all of them are 'auto' and the nearest common ancestor of all the elements has a 'page-break-inside' value of 'avoid', then breaking here is not allowed. * Rule C: Breaking at (2) is allowed only if the number of line boxes between the break and the start of the enclosing block box is the value of 'orphans' or more, and the number of line boxes between the break and the end of the box is the value of 'widows' or more. * Rule D: In addition, breaking at (2) is allowed only if the 'page-break-inside' property is 'auto'. If the above doesn't provide enough break points to keep content from overflowing the page boxes, then rules B and D are dropped in order to find additional breakpoints. If that still does not lead to sufficient break points, rules A and C are dropped as well, to find still more break points. We will also allow breaks between table rows. However, when splitting a table, the table headers should carry over to the next page (but they don't yet).
Signature
protected function _page_break_allowed(Frame
$frame )
Parameters
$frame
— Dompdf\Frame- the frame to check
Returns
- bool
- true if a break is allowed, false otherwise