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

The CSS Working Group just discussed `continue:discard in the fragment tree`.

<details><summary>The full IRC log of that discussion</summary>
&lt;TabAtkins> Topic: continue:discard in the fragment tree<br>
&lt;astearns> github: https://github.com/w3c/csswg-drafts/issues/7708<br>
&lt;TabAtkins> emilio: making line-clamp work using continue:discard has some side effects<br>
&lt;andreubotella> q+<br>
&lt;TabAtkins> emilio: Based on fragmetnation implies the boxes you clamp don't exist, so OM APIs return 0 sizes, etc<br>
&lt;florian> q+<br>
&lt;TabAtkins> emilio: And implies that like border-bottom disappears due to box-decoration-break<br>
&lt;heycam> q+<br>
&lt;TabAtkins> emilio: I think it would be both easier and more useful to impl line-clamp by clamping both content-height, as it does now, and the scrolalble overflow, and hiding the clamped lines rather thand iscarding fragments<br>
&lt;TabAtkins> emilio: There's been some discussion - I think in general it's a lot easier to implement but similarly useful<br>
&lt;TabAtkins> emilio: So easier to reach unprefixed line-clamp<br>
&lt;iank_> q+<br>
&lt;TabAtkins> emilio: We could decide to ship line-clamp as a longhand for now and decide what to do about shorthands later<br>
&lt;astearns> ack andreubotella<br>
&lt;TabAtkins> andreubotella: it's not clear how line-clamp would work with editting (?)<br>
&lt;astearns> s/(?)/(!)/<br>
&lt;TabAtkins> andreubotella: Not clear where carat woudl go if you move past the clamped line<br>
&lt;TabAtkins> andreubotella: Would be less of an issue with emilio's model<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: We'd also need to define how padding/etc will work. using fragmentation gets us that, it defines those<br>
&lt;TabAtkins> florian: One of the goals is to avoid reinventing all that<br>
&lt;TabAtkins> florian: It's true that the discarded part, we have incomplete answers about what to do with abspos in there, what happens to the caret, etc<br>
&lt;TabAtkins> florian: So maybe we do use fragmentation, but rather than discard the post-fragmentation is invisible<br>
&lt;TabAtkins> florian: but saying that it's easier to do it visually is in conflict with the existing knowledge that it's in conflict with visual stuff<br>
&lt;TabAtkins> florian: like bidi content<br>
&lt;TabAtkins> florian: in the fragment model, in document order, hen we have enough content to place the ellipsis; that's different from hiding characters at the end of the line<br>
&lt;TabAtkins> florian: another complaint about visual aspect is you hvae no control over what gets elided and whether it happens at sensible line-break points<br>
&lt;TabAtkins> florian: If using fragmentation, the line breaking properties work<br>
&lt;TabAtkins> florian: Another thing which is useful under the current model (and maybe usable under your new model), a lot of people want to clamp at 3 lines, but a lot want to clamp at 100px<br>
&lt;TabAtkins> iank_: still possible<br>
&lt;TabAtkins> florian: Not impossibl, but undefined. Defined with fragmentation, but not defined without.<br>
&lt;TabAtkins> florian: Don't want to display a half-line, for example<br>
&lt;TabAtkins> florian: So I think we can find ways to define things in terms of fragmentation that are less mysterious<br>
&lt;TabAtkins> florian: And also make some statements about "allowable approximations".<br>
&lt;TabAtkins> florian: But I think entirely discard fragmentation would be unfortunate<br>
&lt;TabAtkins> iank_: clarification, the visual model is purely about subsequent lines<br>
&lt;TabAtkins> iank_: Still do layout placement of ellipsis, etc<br>
&lt;TabAtkins> iank_: So not necessarily in conflict with what you want to achieve<br>
&lt;astearns> q?<br>
&lt;TabAtkins> iank_: I don't wanna have a spec where all the impls do emilio's model, and there's a bunch of soft wording about how it's allowed<br>
&lt;emilio> q+<br>
&lt;TabAtkins> florian: yeah point is not to write fiction, it's just that if we do emilio's model because it's more useful, we shouldn't omit the useful properties of the current spec<br>
&lt;TabAtkins> florian: If we treat it as something like a multicol where additional cols aren't painted, you can have an answer to all the API questions<br>
&lt;TabAtkins> iank_: there's still subtle diffs<br>
&lt;TabAtkins> iank_: in emilio's model it's actually desirable that you don't fragment the borders<br>
&lt;TabAtkins> emilio: say you calmp in a nested block with border/padding.<br>
&lt;TabAtkins> emilio: it has five lines, you clamp at 3, per fragmentation you're supposed to hide the border padding at the bottom<br>
&lt;TabAtkins> fantasai: which element has line-clamp here?<br>
&lt;TabAtkins> emilio: the bfc<br>
&lt;TabAtkins> fantasai: so inside the bfc you have a text with 5 text lines<br>
&lt;TabAtkins> fantasai: the bfc says line-clamp:3<br>
&lt;TabAtkins> fantasai: so you clamp after three lines, then what's after is clamped<br>
&lt;TabAtkins> emilio: no<br>
&lt;TabAtkins> iank_: You're just clamping the content box. You set the content box to the size afte clamping and then layout as normal.<br>
&lt;iank_> https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=10735<br>
&lt;TabAtkins> [retreading the previous example]<br>
&lt;TabAtkins> emilio: the auto height of the inner box is 3 lines tall (plus mbp)<br>
&lt;TabAtkins> florian: So you're reinventing fragmentation...<br>
&lt;TabAtkins> emilio: no fragment would crop the border<br>
&lt;TabAtkins> florian: yeah we have box-decoration-break that lets you control it<br>
&lt;TabAtkins> iank_: well they're not repeated, because this *isn't* fragmentation<br>
&lt;TabAtkins> [missed]<br>
&lt;TabAtkins> florian: If we do it with fragmentation you can choose whether to clip those borders or not<br>
&lt;TabAtkins> iank_: You can here, with border:0<br>
&lt;TabAtkins> florian: No you can't, you can't predict whther the clamp activates or not<br>
&lt;TabAtkins> florian: fragmentation already solved this, dunno why we're reinventing<br>
&lt;TabAtkins> iank_: I think this is a small edge case and most people would expect the behavior from emilio's model<br>
&lt;TabAtkins> astearns: agree this is probably small, but there are tons of decisions in this space about what to do after a fragment break, and we'd have to reinvent all of these<br>
&lt;TabAtkins> emilio: don't think it's reinventing, we just do what we do if you clamp the auto size and visually hide the overlap<br>
&lt;TabAtkins> iank_: very similar to empty-cells on tables, or similar to visibility:hidden but not quite<br>
&lt;TabAtkins> astearns: ther'es a long queue<br>
&lt;florian> q+<br>
&lt;florian> ?<br>
&lt;TabAtkins> heycam: it's probably more like visibility:collapse on those additional lines at the end, they take up no space and aren't rendered<br>
&lt;TabAtkins> iank_: a little diff bc collapse applies to a container, and it of ten gets smushed in size and ther'es some other effects, but yeah<br>
&lt;astearns> ack heycam<br>
&lt;TabAtkins> iank_: the way we'd implement is exactly like empty-cells<br>
&lt;TabAtkins> heycam: at a high level in wk, i think we support getting to the full fragmentation model<br>
&lt;TabAtkins> heycam: But we'll need an interim solution, maybe emilio's or similar<br>
&lt;TabAtkins> heycam: think it would be useful to enumerate the diff between this and the full fragment solution so we can see what it's most similar to<br>
&lt;TabAtkins> heycam: and how likely it is we run into compat issue in the future<br>
&lt;TabAtkins> heycam: like gBCR() effects, etc<br>
&lt;TabAtkins> heycam: If that would change between the two solutions, that might be risky<br>
&lt;astearns> ack iank_<br>
&lt;TabAtkins> iank_: broadly i'm supportive of emilio's suggestion<br>
&lt;TabAtkins> iank_: webdevs strongly desire an unprefixed line-clamp<br>
&lt;TabAtkins> iank_: We, Blink, are probably the closest to ahving a fragmentation solution, but still a ways away<br>
&lt;TabAtkins> iank_: emilio's suggestion means all engines can ship something highly interoperable fairly quickly that will satisfy webdev demands<br>
&lt;TabAtkins> iank_: dont' want fiction, so if we do emilio's, want it in the spec<br>
&lt;TabAtkins> iank_: emilio's gets us there very quickly<br>
&lt;TabAtkins> iank_: I don't think emilio's and fragmentation are exclusive<br>
&lt;TabAtkins> astearns: If we come up with a list of things that are going to be different, how can we move from one to the other?<br>
&lt;TabAtkins> iank_: I don't think that we will<br>
&lt;TabAtkins> iank_: I think we'll be shipping whichever we start with<br>
&lt;TabAtkins> iank_: So like, I don't believe3 we'll be able to straight unprefix -webkit-line-clamp even with emilio's solution, bc devs are already depending on scrollable overlow returning a particular value to tell if clamping applied<br>
&lt;TabAtkins> iank_: I suspect we'll get somethign similar<br>
&lt;TabAtkins> iank_: with abspos at the end, for example<br>
&lt;TabAtkins> heycam: so what i'm hearing is that if we come to the full solution it will need a switch<br>
&lt;TabAtkins> iank_: I think that's ok; they're related problems but not necessarily the same<br>
&lt;TabAtkins> iank_: When we want to truncate content and continue it in a different fragmentatin, i wouldn't be sad if that was a different set of fragmentation properties<br>
&lt;TabAtkins> iank_: people are today using prefixed line-clamp and unhappy about it, we can all ship an unprefixed line-clamp with emilio's solution<br>
&lt;TabAtkins> astearns: but it's still different than emilio's?<br>
&lt;TabAtkins> iank_: P sure we can translate most of it over, only big compat change will be the scrollable overflow size change<br>
&lt;astearns> ack emilio<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: I don't want fiction either, so I'm happy to make accommodations so we can match impls<br>
&lt;TabAtkins> florian: but i wanted to circle back to one potential differenence, because i didn't understand an earlier answer<br>
&lt;TabAtkins> florian: with emilio's, is it possible to "clamp after however many lines it takes to reach 300px"?<br>
&lt;TabAtkins> emilio: could be feasible, define that instead of "hide lines after the third" you'd hide all lines whose block-end edge is after 300px<br>
&lt;TabAtkins> florian: so you'd size the container to 300px, fill it in, start filling in content, then remove after...<br>
&lt;TabAtkins> emilio: not remove<br>
&lt;TabAtkins> florian: you said you'd draw the mbp of children at the bottom, so you'll need to make room to insert those back<br>
&lt;TabAtkins> florian: Note it's not the containr border i'm talking about, it's the content element's border<br>
&lt;TabAtkins> florian: before ocunting lines you don't know how many lines you'll take<br>
&lt;TabAtkins> fremy: you add both top and bottom mbp as you add it, then fill in lines until you hit the limit<br>
&lt;TabAtkins> iank_: yup<br>
&lt;TabAtkins> iank_: our -webkit-line-clamp will already abort and retry for compliated reasons. this is fine<br>
&lt;TabAtkins> florian: what troubles me is not that it's undoable, clearly it is and is even simpler, but it will have something *very similar* to fragmentation which isn't quite fragmentation.<br>
&lt;TabAtkins> astearns: which makes you uneasy<br>
&lt;TabAtkins> florian: yeah<br>
&lt;TabAtkins> florian: The bidi part I'm not sure how you solve<br>
&lt;TabAtkins> florian: we don't control what chunk of text on the last line is okay to remove<br>
&lt;TabAtkins> florian: this is a known problm of the existing paint-based ellipsis<br>
&lt;TabAtkins> emilio: i think blink does layout-time ellipsis<br>
&lt;TabAtkins> emilio: presuambly they ahve to reshpare arbitrary content when inserting it to avoid clipping<br>
&lt;TabAtkins> florian: and it can push content around?<br>
&lt;andreubotella> q+<br>
&lt;astearns> zakim, close queue<br>
&lt;Zakim> ok, astearns, the speaker queue is closed<br>
&lt;TabAtkins> iank_: I'll ahve to double check, but i think we'll reshape, like if you land on a bad ligature we'll go back and split it<br>
&lt;TabAtkins> florian: it's not just painting a ligature, it's about dropping letters or a whole word<br>
&lt;TabAtkins> florian: simila for an abspos in the content, the static position changes depending on whether it's pushed to the next line or not<br>
&lt;TabAtkins> iank_: I think abspos are break oppos in our impl for this reason<br>
&lt;TabAtkins> astearns: next queue<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: there's a number of directions people ahve wanted to extend this in, and starting from fragmentation model gets you to a bunch of different places that we want to end up<br>
&lt;TabAtkins> fantasai: while starting from a visual model doesn't<br>
&lt;TabAtkins> fantasai: I also pasted a funny test case<br>
&lt;TabAtkins> fantasai: it's p weird<br>
&lt;fantasai> https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=10738<br>
&lt;fantasai> fantasai: This is the model we *want*?<br>
&lt;TabAtkins> andreubotella: regarding ellipsis, in current fragmentation there's block-ellipsis where youc an repalce the final lines with something<br>
&lt;TabAtkins> andreubotella: how would this work?<br>
&lt;TabAtkins> andreubotella: if the string has rtl and ltr characters?<br>
&lt;TabAtkins> florian: It's specified, i don't recall the details. I think we insert the string as a string without wrapping oppo and with bidi isolation<br>
</details>


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


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

Received on Friday, 16 September 2022 23:48:54 UTC