Skip to content

Commit

Permalink
fix: margin-break:discard not working properly
Browse files Browse the repository at this point in the history
- fix #1123
  • Loading branch information
MurakamiShinyu committed Feb 8, 2023
1 parent 910bedc commit 660eefd
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/core/src/vivliostyle/vgen.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1424,7 +1424,8 @@ export class ViewFactory
} else {
const marginBreak = computedStyle["margin-break"];
if (
marginBreak === Css.ident.discard ||
(marginBreak === Css.ident.discard &&
(atUnforcedBreak || this.isAtForcedBreak())) ||
(marginBreak !== Css.ident.keep &&
atUnforcedBreak &&
!this.isAtForcedBreak())
Expand Down Expand Up @@ -1503,7 +1504,12 @@ export class ViewFactory
nodeContext && !nodeContext.after;
nodeContext = nodeContext.parent
) {
if (Break.isForcedBreakValue(nodeContext.breakBefore)) {
if (
Break.isForcedBreakValue(nodeContext.breakBefore) ||
nodeContext.sourceNode === nodeContext.sourceNode.ownerDocument.body ||
nodeContext.sourceNode ===
nodeContext.sourceNode.ownerDocument.documentElement
) {
return true;
}
if (
Expand Down

0 comments on commit 660eefd

Please sign in to comment.