vivliostyle.js
vivliostyle.js copied to clipboard
Vivliostyle tries to generate infinite pages
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 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.
This problem occurs because of the following reasons:
-
The
page-header
andbody
partitions are overlapped. (Sameleft
andright
values and omittedtop
value which is treated as 0.)- In the result, the available width in the
body
partition becomes 0, because thepage-header
partition is rendered first and it intrudes thebody
partition.
- In the result, the available width in the
-
display: flex;
is specified on thebody
element. Note that the flex box has problem on fragmentation, see- #594