Skip to content

Commit

Permalink
fix: prevent running elements and absolutely positioned elements from…
Browse files Browse the repository at this point in the history
… being broken

- fix #1430
  • Loading branch information
MurakamiShinyu committed Dec 26, 2024
1 parent 1298adb commit 651065e
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/core/src/vivliostyle/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2532,6 +2532,11 @@ export class Column extends VtreeImpl.Container implements Layout.Column {
* Determines if a page break is acceptable at this position
*/
isBreakable(flowPosition: Vtree.NodeContext): boolean {
for (let nc = flowPosition; nc; nc = nc.parent) {
if (LayoutHelper.isOutOfFlow(nc.viewNode)) {
return false;
}
}
if (flowPosition.after) {
return true; // may be an empty block
}
Expand Down Expand Up @@ -2560,6 +2565,11 @@ export class Column extends VtreeImpl.Container implements Layout.Column {
if (!nodeContext) {
return false;
}
for (let nc = nodeContext; nc; nc = nc.parent) {
if (LayoutHelper.isOutOfFlow(nc.viewNode)) {
return false;
}
}
if (LayoutHelper.isOrphan(nodeContext.viewNode)) {
return false;
}
Expand Down

0 comments on commit 651065e

Please sign in to comment.