[csswg-drafts] [css-overflow-4] [css-break] How does `widows` interact with `continue: discard`? (#9235)

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

== [css-overflow-4] [css-break] How does `widows` interact with `continue: discard`? ==
```html
<div style="continue: discard; height: 4lh; widows: 2;">
  Line 1<br>
  Line 2<br>
  Line 3<br>
  Line 4<br>
  Line 5
</div>
```

[`continue: discard`](https://drafts.csswg.org/css-overflow-4/#continue) makes the div into a fragmentainer and discards any content after the first break, forced or unforced. Since the height is `4lh`, "Line 5" is certainly after the first break, but what about "Line 4"? If following fragments were not discarded, "Line 4" would be after the unforced break in order to avoid a single widow, but should that work the same with discarded fragments?

The spec text for `continue: discard` does not say anything about how an unforced break is computed, so it is reasonable to assume that the same behavior applies as for non-discarding fragmentation. On the other hand, since the spec text for  `widows` talks about lines in a fragment, you could see this as not applying to discarded fragments.

One thing to note is that the inital value of `widows` is 2, so it might come as a surprise to developers than the clamping sometimes happens one line earlier than it should, depending on the number of lines in the `continue: discard` box. It certainly came as a surprise to me when working on my in-progress implementation of `continue: discard` in Chromium, taking me a while to realize it was not a bug in my layout code.

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


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

Received on Thursday, 24 August 2023 10:56:06 UTC