-
Notifications
You must be signed in to change notification settings - Fork 719
[css-overflow] Is continue: discard working in the fragment tree useful? #7708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
If it just stopped painting them, then the content would still be overflowing, but scrolling would just reveal a big empty area, yeah? I'm not sure why that would be preferable. ( |
Well, we could spec that line-clamp affects the scrollable overflow, by not accounting for overflow caused by clamped lines, the same way it affects the auto block size, right? I think that'd still be much easier to implement and maybe more intuitive to authors |
At that point, what's making it different from discarding the fragments after the break, then? You already have the ability to shift the fragments to the next rendering context, so I'm not clear what the problem you're trying to solve here is. |
Well, for once, it doesn't change the interactions with the OM (e.g., |
So you're proposing we define that the overflow after the break opportunity doesn't break, but instead becomes invisible ink overflow? (I'm also curious what the essential difference is between those two cases, btw. I would naively think that "push these to nowhere" is similar in difficulty, if not easier?) |
One specific difference is the OOFs would propagate up from the clamped content. |
Ah, in the "become invisible ink overflow" case? Whereas in the "drop the fragments" case the OOFs after the break would just be gone? |
Yup that's correct. |
The other difference/side-effect is the geometry APIs |
The CSS Working Group just discussed The full IRC log of that discussion |
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 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
If anyone has questions in the same vein, that would help explore the behavior (including but not limited to exposing differences between |
I've been toying with a prototype implementation of With that, this is how this prototype handles some of these questions.
The bottom padding and border is kept, but the bottom margin isn't. (This is something that is currently observable in Chromium's implementation of In particular, if you have a div with m/b/p whose only content is a div with m/b/p, and the clamping happens in the inner div, the inner div will also not keep its margin. If the m/b/p for both elements are symmetric, you can observe that as a difference in the actual spacing between the top and bottom:
The line count is part of the formatting context, so if you have
Same as above: the line count adds up across the divs, and any divs after the clamped line will be completely hidden.
My implementation so far hides things that are after the clamp point in the layout tree, regardless of where they show up visually. So (7) is hidden, (8) is shown outside the element.
Same as above, floats anchored in retained lines are shown, even if they visually overflow or show completely outside of the element's bounds. Floats in the discarded lines are hidden. Whether they're replaced or not doesn't make a difference.
As far as
Currently I'm always showing abspos. If the block inset properties are not set, the abspos will show up wherever it would without
Chromium's implementation of |
If the content isn't on a line it will cut off the content outside the formatting context - this is similar to monolithic content. As with 14 they aren't considered for lines.
You get the standard geometry as you'd expect if they weren't hidden. This is similar to how
Same as above. They will be visible if not hidden, and same the same geometry.
Unclear what you mean by truncating here, but I'll assume this is the box with line-clamp on it. It'll be the height of it in the clamped state.
Unclear what tracated box means here, but i'll assume a box that was been hidden. It'll behave the same as if it wasn't truncated.
These questions don't seem specific to the "collapse" behaviour.
Unclear - what the expected behaviour would be - this is similar to existing clamping behaviour (e.g. text-overflow).
Likely yes. |
So in summary the rules appear to be:
|
I believe authors want to be able to know the actual geometry of the element. This is partly covered by #9433, meaning, the APIs should only return the retained lines' geometries. (That might also be controlled via an option.) Sebastian |
They are. The spec currently answers these questions while assuming |
Here's where I'm at. We have two different approaches.
My suggestion would be to temporarily set aside the question of which approach is the winner to pursue, as that seems to be holding back refining the nuances of each. I'd rather explore in detail what each approach means, resolve issues about them, use experimental implementations to find out about compat, performance, play with the pros and cons of their differences…Though the underlying mechanism is different, there may be things that each approach can learn from the other, and we should explore those. The good news is that they both fit withing the same framework of interacting properties, as they would both be keywords on the So how about that: we write both of them down, file and attempt to resolve issues against either, iterate for a while with insight learned from experimental implementations, and see where that takes us. |
The CSS Working Group just discussed
The full IRC log of that discussion |
In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main@{#1364495}
In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main@{#1364495}
…ter a line box, a=testonly Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main@{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482
…ter a line box, a=testonly Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main@{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482
…ter a line box, a=testonly Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482 UltraBlame original commit: 5751601c841de1f7d26475e22ebaa4d8ca71b474
…ter a line box, a=testonly Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482 UltraBlame original commit: 5751601c841de1f7d26475e22ebaa4d8ca71b474
…ter a line box, a=testonly Automatic update from web-platform-tests [line-clamp] Always clamp immediately after a line box In our initial implementation of `line-clamp: auto`, we allowed clamping after lineless boxes, in order to better match the behavior of `line-clamp` as it follows from the spec's `continue: discard` model, even though our implementation uses a different model which is not yet in the specification (see w3c/csswg-drafts#7708). However, in hallway conversations in TPAC 2024, we agreed that it would be better for this model to instead only allow clamping immediately after a line. If the first line does not fit, we calmp at the first line even if that overflows the clamp height. If there are no lines, we do not clamp. This patch implements this. Additionally, a previous patch (https://crrev.com/c/5868971) had increased the memory size of `LineClampData` from 8 to 20 bytes, causing a memory regression. This patch shrinks it to 12 bytes, since `LineClampData` no longer needs to keep track of how many block boxes there are between the last line and the clmap point, and now OOFs after the clamped line behave the same when clamping by a number of lines or by a height, so there is no need for a flag to distinguish these behaviors. This patch also adds a size assertion for `LineClampData`. This patch also changes or removes some WPT tests that were written assuming the previous behavior. Bug: 40336192, 368114054 Change-Id: I8c8afebb5dc566de92112cee2fcf24a2e60b42c8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5904459 Reviewed-by: Ian KilpatrickCommit-Queue: Andreu Botella Cr-Commit-Position: refs/heads/main{#1364495} -- wpt-commits: 1563c1e3a851d13982c2e9a0c2eabb8287823b35 wpt-pr: 48482 UltraBlame original commit: 5751601c841de1f7d26475e22ebaa4d8ca71b474
The CSS Working Group just discussed
The full IRC log of that discussion |
* [css-overflow-4] Draft spec for `continue: collapse` (#7708) * Clarification about float clearance in the automatic block size * Update to only allow clamping after a line * Apply suggestions from code review Co-authored-by: Florian Rivoal* Update css-overflow-4/Overview.bs Co-authored-by: Florian Rivoal * Update css-overflow-4/Overview.bs * Update css-overflow-4/Overview.bs * Update css-overflow-4/Overview.bs * Update css-overflow-4/Overview.bs * Update css-overflow-4/Overview.bs * Update for #10439 * Update for #11962 * Update for #10868 --------- Co-authored-by: Florian Rivoal Co-authored-by: Tab Atkins Jr.
The resolution above has been implemented, and further discussion of details continues in other issues. Closing. |
The main usefulness of it is clipping overflowing content from e.g.
line-clamp
, but it seems it'd be easier (and more compatible with how-webkit-line-clamp
works now) if this behaved more likevisibility: hidden
(i.e., stop painting them) rather thandisplay: none
on the overflowing items?It'd also be easier to implement, generally, and I'm not sure when it'd be less useful. It might be that I'm missing something obvious?
cc @bfgeek @frivoal @fantasai
The text was updated successfully, but these errors were encountered: