[csswg-drafts] [css-overflow-4] Unexpected behavior of `continue: discard` on multicolumn containers with spanners (#8721)

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

== [css-overflow-4] Unexpected behavior of `continue: discard` on multicolumn containers with spanners ==
The definition of `continue: discard` in [css-overflow-4, section 5.3](https://w3c.github.io/csswg-drafts/css-overflow-4/#continue) (not the one in appendix A) says that, for a multicolumn container, overflow columns are discarded, which is to say they are not laid out or painted.

Consider the following case, though:

```css
.multicol {
  columns: 3;
  continue: discard;
}
.multicol p {
  break-after: column;
  break-inside: avoid;
}
.spanner {
  column-span: all;
}
```

```html
<div class="multicol">
  <p>Column 1</p>
  <p>Column 2</p>
  <p>Column 3</p>
  <p>Overflow column</p>
  <div class="spanner">Spanner</div>
</div>
```

In the case of block containers, or of region breaks in a multicolumn container, `continue: discard` will discard the remainder of the container, which can be done in implementations by stopping layout at the end of a fragment. However, with overflow columns before a spanner, the layout must resume at the spanner.

My understanding is that the layout at the spanner, and at any further multicol lines after it, is independent from the layout the overflow columns would have, so there is no actual contradiction. I think this might be implemented correctly by having multicol line boxes in the box tree, such that only the remainder of the multicol line box would be discarded:

```
MulticolBox
  MulticolLineBox
    BlockBox ("Column 1")
    BlockBox ("Column 2")
    BlockBox ("Column 3")
    BlockBox ("Overflow column")
  MulticolSpanner
  MulticolLineBox
    ...
```

But this would be unexpected behavior all the same, since in terms of the DOM tree there would be a range that is skipped by layout. And Chromium's LayoutNG implementation of multicol doesn't use multicol line boxes, instead treating spanners as if they had the equivalent of `break-before: multicol-line`.

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


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

Received on Friday, 14 April 2023 13:26:13 UTC