Skip to content

[css-break-3] Should broken boxes always be extended to fill the gap? #12801

@Psychpsyo

Description

@Psychpsyo

CSS Break 3 says, in 5.3. Splitting Boxes, that when a box gets split, it's block size is effectively increased. This leads to its backgrounds and borders being painted into the remaining empty space in that fragmentainer.

This usually seems desirable, but it gets ugly when a table cell with the rowspan attribute gets broken due to the rows that it spans falling into different fragmentainers. In this case, the empty space that comes to exist between those rows has nothing in it, apart from the rowspan-cell, which I'd expect to only render next to the rows that it spans.

I think there should either be an exception for these cells, or a CSS property that can control this behavior, similar to box-decoration-break. Alternatively, box-decoration-break could be extended to accept something like [ slice | clone ] || skip-gap instead of just slice | clone. This new behavior should, in my opinion, be applied to rowspan cells by default, so this could be added to the UA stylesheet:

td[rowspan], th[rowspan] {
    box-decoration-break: skip-gap;
}

The UA stylesheet addition would be a breaking change, though currently only Safari manages to properly break these cells at all. Both Chrome and Firefox fail to lay them out correctly in different ways. (Chrome doesn't extend the height on the rowspanned cell so it doesn't reach the end of the second row and Firefox draws the background only inside the first fragmentainer and only next to the first row.)

TL;DR:
Image

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions