Yeah, this is a known issue, and it's kind-of intended behavior. The underlying issue is that we don't properly support splitting a single grid-row across several pages -- we have a "slicing" approach which kinda-works but can e.g. cut lines of text in half, e.g. here: ``` data:text/html,<!DOCTYPE html><body style="margin:0"><div style="display:grid"><div><div style="height:calc(100vh - 0.5em)">a</div>b</div> ``` (I'm not sure if other browsers do anything much better, except perhaps by having heuristics to avoid slicing text in half -- we have bug 1759926 filed on doing that, at least.) Anyway -- we try to avoid the need to do these sorts of "slices" (or reduce how many we need) -- so if we encounter a grid-row that runs off of a page and will be sliced, and it's not already at the top of the page, then we push it to the next page so that it can draw more of its content before it needs to be sliced. (We do this for other things that we fundamentally can't page-break "properly" as well -- e.g. `display:inline-block`)
Bug 1852515 Comment 2 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
Yeah, this is a known issue, and it's kind-of intended behavior. The underlying issue is that we don't properly support splitting a single grid-row across several pages -- we have a "slicing" approach which kinda-works but can e.g. cut lines of text in half, e.g. here ``` data:text/html,<!DOCTYPE html><body style="margin:0"><div style="display:grid"><div><div style="height:calc(100vh - 0.5em)">a</div>b</div> ``` (This testcase probably renders in print-preview with "b" split between page 1 and page 2 -- it does for me, anyway.) I'm not sure if other browsers do anything much better, except perhaps by having heuristics to avoid slicing text in half -- we have bug 1759926 filed on doing that, at least. Anyway -- we try to avoid the need to do these sorts of "slices" (or reduce how many we need) -- so if we encounter a grid-row that runs off of a page and will be sliced, and it's not already at the top of the page, then we push it to the next page so that it can draw more of its content before it needs to be sliced. (We do this for other things that we fundamentally can't page-break "properly" as well -- e.g. `display:inline-block`)