vivliostyle.js icon indicating copy to clipboard operation
vivliostyle.js copied to clipboard

Vivliostyle tries to generate infinite pages

Open nanikamado opened this issue 2 years ago â€ĸ 2 comments

Build or preview of the following HTML does not finish:

<!DOCTYPE html>
<html lang="ja">

<head>
    <meta charset="utf-8">
    <title>įž…į”Ÿé–€</title>
    <style>
        body {
            display: flex;
        }
        
        @page {
            size: A4;
        }
        
        @-epubx-page-template {
            .page-header {
                -epubx-flow-into: page-header;
                -epubx-flow-options: static;
            }
            @-epubx-page-master {
                @-epubx-partition body {
                    -epubx-flow-from: body;
                    left: 3rem;
                    right: 3rem;
                }
                @-epubx-partition page-header {
                    -epubx-flow-from: page-header;
                    left: 3rem;
                    right: 3rem;
                }
            }
        }
    </style>
</head>

<body>
    <div class="page-header">įž…į”Ÿé–€</div>
    <p>或æ—Ĩぎ暎斚ぎäē‹ã§ã‚る。一äēēぎ下äēēが、įž…į”Ÿé–€ãŽä¸‹ã§é›¨ã‚„ãŋを垅つãĻゐた。</p>
    <p>åģŖい門ぎ下ãĢは、こぎį”ˇãŽå¤–ãĢčĒ°ã‚‚ゐãĒã„ã€‚å”¯ã€æ‰€ã€…ä¸šåĄ—ãŽå‰Ĩげた、大きãĒ大きãĒåœ“æŸąãĢã€čŸ‹čŸ€ãŒä¸€åŒšã¨ãžã¤ãĻゐる。įž…į”Ÿé–€ãŒã€æœąé›€å¤§čˇ¯ãĢあるäģĨ上は、こぎį”ˇãŽå¤–ãĢも、雨やãŋをする市åĨŗįŦ ã‚„揉įƒå¸Ŋ子が、もうäēŒä¸‰äēēはありそうãĒもぎである。それが、こぎį”ˇãŽå¤–ãĢはčĒ°ã‚‚ゐãĒい。
    </p>
</body>

</html>

It seems that vivliostyle is trying to generate infinite pages.

Command

vivliostyle preview index.html

Version

cli: 4.8.2
core: 2.14.4

nanikamado avatar Mar 19 '22 05:03 nanikamado

@nanikamado Thanks for the bug report. It seems a problem of Vivliostyle.js core, so I transfer this to https://github.com/vivliostyle/vivliostyle.js/issues.

MurakamiShinyu avatar Mar 19 '22 09:03 MurakamiShinyu

This problem occurs because of the following reasons:

  • The page-header and body partitions are overlapped. (Same left and right values and omitted top value which is treated as 0.)

    • In the result, the available width in the body partition becomes 0, because the page-header partition is rendered first and it intrudes the body partition.
  • display: flex; is specified on the body element. Note that the flex box has problem on fragmentation, see

    • #594

MurakamiShinyu avatar Apr 09 '22 08:04 MurakamiShinyu