Re: [csswg-drafts] [css-overflow] Is continue: discard working in the fragment tree useful? (#7708)

We've had good discussions during TPAC breaks about what a simpler mechanism than the one currently specified might be, and I have been trying to understand in detail what the suggested approach means.

As a placeholder, let's call this new approach `continue: collapse`, in contrast to `continue: discard`.

Prior to trying to spec it out, I'd like to make sure we're all on the same page. Here's a collection of situations which I hope will help us confirm whether we agree about the behavior we're talking about, maybe explore some possible variants, and help us evaluate whether we like the resulting behavior. (We might need a break-out session to go through this.)

(In the examples below, a `/` indicates where the cut-off point would fall.)

1. The base case is something like this: an otherwise unstyled article with a bunch of lines, cut after 3 lines, or after 300px
    ```html
    <article style="continue: collapse; max-lines: 3">.../..</article>
    ```
    ```html
    <article style="continue: collapse; max-height: 300px">.../..</article>
    ```
    I think in this situation, there would be no visible difference between the proposed behavior for `continue: collapse` and `continue: discard`. Right?

2. If the article itself has a margin/border/padding, what does that do? Nothing special I expect, as it's the content of the article that's getting cliped/discarded/collapsed, and the article itself is unaffected and nothing happens to its m/b/p.
3. If the article contains a div (which itself contains all the content) which has m/b/p, what does that do?
    ```html
    <article …>
      <div style="border: solid red">../.</div>
    </article>
    ```
    In particular:
    1. Is the bottom border kept or not?
    2. Is the height of this border taken into account when determining how much content to collapse/discard under the `max-height` constraint?
    3. Is the answer the same for padding (probably)?
    4. Is the answer the same for margins (maybe)?
5. If the article contains a div which has m/b/p, and there's some more text nodes after that, what does that do?
    ```html
    <article …>.
      ...
      <div style="border: solid red">../.</div>
      ...
    </article>
    ```
    Same question as the (3), but taking into account the presence of text nodes outside of the div.
6. If the article has several child elements with m/b/p, and we're dropping content from several of them. Do you keep the (now empty) divs after the clamping point at all? if yes, what happens to their m/b/p ?
    ```html
    <article …>
      <div style="border: solid red">...</div>
      <div style="border: solid red">../.</div>
      <div style="border: solid red">...</div>
      <div style="border: solid red">...</div>
    </article>
   ```
7. How do the previous 3 questions (and any other that seems relevant) interact with `box-decoration-break`? Note: `box-decoration-break` is already shipping in a least one Browser (Firefox), so while we can retro-fit an initial auto value if needed, we cannot not skip thinking about it altogether.
8. If there's a rel-pos anchored in the discarded/collapsed lines, what happens to it?
9. If there's a rel-pos anchored in the _retained_ lines, shifted far enough down that it would be visually after the cut-off point, what happens to it?
10. If there's a float anchored in the discarded/collapsed lines. What happens to it?
11. If there's a _replaced_ float anchored in the a _retained_ line. What happens to it? Does it get truncated? Does it stay entirely? What effect does it have on the height of its containing block?
12. If there's a _non-replaced_ float anchored in an _retained_ line. What happens to it? Does it get truncated? Does it stay entirely? What effect does it have on the height of its containing block?
13. If there's an tall inline-level box (image, inline-block, orthogonal inline-level box…) in a retained line, does it simply grow the line and the discarding/collapsing works on that bigger line, or something else?
14. If there's a abspos anchored in the discarded/collapsed lines. What happens to it? If not disappear, what is its static position? Does bottom:0 take it to the bottom of the box as trucated, or the the (invisible) bottom of the theoretical box?
15. If you're capping by `max-lines`, and there are block-level descendants of the `continue:collapse` element with more structure than just a pile of lines (nestbed BFCs, block-level orthogonal flow, a table, a grid, a block level image…), do you simply ignore them when counting lines, or something else?
16. If you're capping by `max-height`, and the cut-off point falls into something that has more structure than just a pile of lines (nestbed BFCs, block-level orthogonal flow, a table, a grid, a block level image…), what do you do?
17. What do you get if you use any of the JS APIs to query about the geometry of boxes entirely within the discarded/collapsed content?
18. What do you get if you use any of the JS APIs to query about the geometry of boxes partially within the discarded/collapsed content?
19. How do the intrisinsic size keywords resolve on the height of the truncating/containing box?
20. How do the intrisinsic size keywords resolve on the truncated box?
21. How do you insert the ellipsis text on the last line that remains:
    1. Does it remove text in logical or visual order (before/after bidi reordering)?
    2. Where does the ellipsis get placed, if inserted in a complicated bidi phrase?
    3. To make room for the ellipsis text, do we remove any number of individual grapheme cluster or do we respect the various css-text properties governing what are acceptable line-breaking opportunities?
    4. Is the content removed from the last line to make room for the ellipsis pushed to the discarded lines? That could for example be observed through the static position of abspos elements anchored in the discarded/collapsed content.
    5. Is the ellipsis text drawn in the block's font/font-size, the removed text's font/font-size, or something else?
    6. Does  ellipsis text affect the height of the line it's injected in if it happens to be the tallest (or only thing) on that line?
    7. What happens if ellipsis text is too long to fit the line?
22. What happens when you select all on the page and copy to the clipboard? Do we get the hidden content? What about the ellipsis?
23. Is the discarded content in the accessibility tree?

If anyone has questions in the same vein, that would help explore the behavior (including but not limited to exposing differences between `continue: collapse` and `continue: discard`), feel free to add some more.

-- 
GitHub Notification of comment by frivoal
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7708#issuecomment-1274127954 using your GitHub account


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

Received on Tuesday, 11 October 2022 06:02:52 UTC