[csswg-drafts] [css-break] fragmenting the content of monolithic elements (#6326)

frivoal has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-break] fragmenting the content of monolithic elements ==
Some elements are inherently [monolithic](https://drafts.csswg.org/css-break-3/#monolithic), as their content is just a single thing, like images.

Others, like ”elements with overflow set to auto or scroll and any elements with overflow: hidden and a non-auto logical height (and no specified maximum logical height)” (from the same spec), or [Size containment boxes](https://drafts.csswg.org/css-contain-1/#size-containment-box) have content that could be fragmented, but due to how the containing element is being laid out, we chose to treat them as being monolithic.

Monolithic content is not supposed to be broken (that's the whole point), but there are cases where you need to break it anyway. The end of https://drafts.csswg.org/css-break-3/#unforced-breaks says:

> Finally, if there are no possible break points below the top of the fragmentainer, and not all the content fits, the UA may break anywhere in order to avoid losing content off the edge of the fragmentainer. In such cases, the UA may also fragment the contents of monolithic elements by slicing the element’s graphical representation. However, the UA must not break at the top of the page, i.e. it must place at least some content on each fragmentainer, so that each fragmentainer has a non-zero amount of content, in order to guarantee progress through the content

This is reasonable, but maybe should be relaxed / generalized a bit?

For instance, if a monolithic block box is just tall enough to fit 3 lines and does have 3 lines of content, and it gets fragmented in 2 equal parts, you could either put 1 line in the first and 2 in the second letting that last line overflow, or you can put 1.5 lines in each. Both seem bad, so for that case, what's currently specified is probably fine, as we cannot do better.

But if the monolithic block with 3 lines of content is tall enough to fit 4 lines of content, and gets sliced at 1.5 lines down, leaving 2.5 lines worth of space in the second part, it might be nice to allow the UA to put 1 line in the first fragment, and 2 in the second one, as that'll be more readable than slicing through the middle line. From the point of view of the ancestor of the monolithic element, nothing has changed, and it just got sliced anyway, but for its content, it might be marginally nicer.

I don't know if this is something any UA is contemplating doing. Is this worth relaxing the spec to allow for this, or is the current simpler requirement to just slice if you need to break good enough?

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6326 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 31 May 2021 06:06:20 UTC