ariya/phantomjs — pull request #12704 by donji (2014-11-03 20:51:42+00:00)
Title: implement "page-break-inside: avoid" for non-floating block elements

This patch is taken from https://bugs.webkit.org/show_bug.cgi?id=5097#c17
The following test page will have green block starting at new page after fix.
index.Html:

This is first

this is second

third

multi.css:

#div1 {
width:900px;
height:600px;
background-color:red;
-webkit-print-color-adjust: exact;
}
#div2 {
width:800px;
height:900px;
background-color:green;
page-break-inside: avoid;
-webkit-print-color-adjust:exact;
}
#div3 {
width:700px;
height:800px;
background-color:yellow;
-webkit-print-color-adjust: exact;
}