How to use CSS3 properties for orphans and widows using xhtmlrenderer (flying saucer) R8?

I read a bugfix in this description , in which xhtmlrenderer should support CSS3’s orphan and widow features from R5. Using R8 doesn't seem to work.

div.textContent {
    orphans: 5;
    widows: 3;
}

But it looks like this:

Wrong paragraph breaking

A paragraph (an element of a div block) is divided into two parts, although it should not.

Any ideas or experience with this? Thank!

+3
source share
1 answer

This is a bug in the Flying Saucer (xhtmlrenderer). There BlockBox.javais a function in B satisfyWidowsAndOrphans, but it is called only after the call isNeedPageClear. I created an issue in the problem tracker.

Please note that the page-break-inside: avoid;css rule works.

+4

Source: https://habr.com/ru/post/1790430/


All Articles