Re: [csswg-drafts] [css-break] Consider adding clone-most-nested

The CSS Working Group just discussed `CSS Break`.

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: CSS Break<br>
&lt;TabAtkins> ScribeNick: TabAtkins<br>
&lt;TabAtkins> fantasai: We had a request from Nigel to add a value for the box-decoratio-break property. CAn you explain?<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/1633<br>
&lt;TabAtkins> nigel: IMagine you're displaying subtitles, and for a11y you want to put a high-contrast background behind the text. Not on the whole &lt;p>, just behind the lines.<br>
&lt;TabAtkins> nigel: You don't want the bg to be tightly wrapped to the text edges - you want it to extend slightly out for readability<br>
&lt;TabAtkins> nigel: But you cant predict the linebreaks.<br>
&lt;TabAtkins> nigel: That's okay righ tnow with b-d-b: clone<br>
&lt;TabAtkins> nigel: But then what if you have a span in the middle of the text with a different color bg.<br>
&lt;TabAtkins> nigel: And the break falls in the middle of that other span.<br>
&lt;TabAtkins> nigel: You want the span's bg to be what extends; you want to use padding to display that.<br>
&lt;TabAtkins> nigel: So the most relevant bg color to "extend" is from the innermost element at the break, not the element that sets b-d-b.<br>
&lt;TabAtkins> nigel: fantasai asked a good question.<br>
&lt;TabAtkins> nigel: Should it be "most nested" or "most nested thing that *counts", paraphrasing.<br>
&lt;TabAtkins> fantasai: I think we have this problem generally with fragmentation.<br>
&lt;TabAtkins> fantasai: At the break, you want to ahve a little bit of extra padding with the bg beneath it.<br>
&lt;TabAtkins> fantasai: It's possible that maybe we can solve this by just saying "add this amount of padding at the break".<br>
&lt;TabAtkins> fantasai: Whether that solves this is, do you need borders too? Or just backgrounds.<br>
&lt;TabAtkins> fantasai: Like a border around the inline that only closes if it's the innermost nested border?<br>
&lt;TabAtkins> fantasai: Seems weird, I guess not.<br>
&lt;TabAtkins> nigel: I think for border-radius you want [...]?<br>
&lt;TabAtkins> fantasai: If both have b-r; normally we'd just slice and get the green and black backgrounds overlapping eachother on a clean break.<br>
&lt;TabAtkins> fantasai: If only the green gets a border-radius, you'll see the black background peeking out from under the green.<br>
&lt;TabAtkins> fantasai: That's a problem.<br>
&lt;TabAtkins> Rossen: I think this is in conjuction with the line-padding property in TTML, right?<br>
&lt;TabAtkins> nigel: Yeah.<br>
&lt;dbaron> a general 'break-padding' property sounds like it could be useful...<br>
&lt;TabAtkins> Rossen: box decoration and fragmentation, you're talking about linebreaking, nto general box breaking<br>
&lt;TabAtkins> TabAtkins: It can be about boxes too.<br>
&lt;astearns> I think it would be helpful to have a diagram in https://www.w3.org/TR/ttml2/#style-attribute-inlineAreaBreak that showed a rendering using each value for cases where there's a difference<br>
&lt;TabAtkins> Rossen: Sure, but that's not his requirement.<br>
&lt;TabAtkins> Rossen: Also something we don't have in CSS is line-padding that extends in every break.<br>
&lt;fantasai> dbaron, yeah, that's what I was thinking. But it doesn't solve the border-radius case he was describing<br>
&lt;TabAtkins> nigel: Line padding was introduced to IMSC when border-radius wasn't available in TTML; at that point the only styling you could do was bg-color and get a square box.<br>
&lt;TabAtkins> nigel: Now with b-r it's gotten more complicated, and probably need to extend it a little further than just the line-padding semantic, to include the other bg effects (or things that otherwise affect the background)<br>
&lt;TabAtkins> nigel: Your point about targeting line areas specifcially is well made.<br>
&lt;TabAtkins> nigel: If there was a way to say "for each line in this &lt;p>, apply this styling" that would be really helpful, but that doesn't seem to exist yet.<br>
&lt;TabAtkins> fantasai: I think it would be relatively easy to describe as only things that work are background and things on the box, not background.<br>
&lt;Rossen> Here's nigel's example https://github.com/w3c/imsc-tests/blob/master/imsc1/png/linePadding2/0.000000.png<br>
&lt;TabAtkins> fantasai: Once inheritance applies it's hard.<br>
&lt;TabAtkins> fantasai: We have this problem with ::first-line; it's a mess, lots of bugs, spec isn't precise enough despite our efforts.<br>
&lt;TabAtkins> fantasai: But if it's just about "background here, put a b-r on it", it's not too hard.<br>
&lt;TabAtkins> fantasai: Not high prio to do in browsers, but wouldn't be too hard.<br>
&lt;TabAtkins> iank_: We don't have an architecture that can support that (styling lines individually). It's several years away.<br>
&lt;TabAtkins> Rossen: The existing model of line boxes in most impls, certainly in Edge, is not easily extdendable to support this. Not impossible, but it would be quite hard.<br>
&lt;TabAtkins> Rossen: Tho this is a valid use-case and feature.<br>
&lt;TabAtkins> fantasai: What's line-padding?<br>
&lt;TabAtkins> Rossen: Imagine you have a span - I posted on of Nigel's examples - that adds bg to the current inline. And the span breaks. You can put padding on the span - you'll get padding at the start and end of the span. If it fits on one line, great; the bg will extend a little past the text.<br>
&lt;TabAtkins> Rossen: But if the text breaks in the middle, you have some padding on start of first fragment and end of last fragment, but all other broken edges have no padding.<br>
&lt;TabAtkins> Rossen: line-padding feature adds padding to every break-edge.<br>
&lt;TabAtkins> Rossen: Basically to the linebox itself.<br>
&lt;TabAtkins> Rossen: if the linebox has background, it extends.<br>
&lt;TabAtkins> fantasai: The linebox is wider than that actually, but I get what you're saying.<br>
&lt;TabAtkins> fantasai: Taht makes sense, and I see how adding border-radius would be tricky.<br>
&lt;TabAtkins> nigel: Doing just the inline-padding isn't the only place we want to do something with line areas.<br>
&lt;TabAtkins> nigel: Another feature, fill-line-gap, says "draw background areas between lines".<br>
&lt;TabAtkins> nigel: Hard now, because character heights are UA-dependent.<br>
&lt;TabAtkins> nigel: So can't specify a padding-top/bottom that correctly fills in the space between lines.<br>
&lt;TabAtkins> fantasai: Question I have - you ahve a line of text with some line-spacing, say 1.5. You're seeing there's a bg below the text, and a .5em gap between the lines.<br>
&lt;TabAtkins> fantasai: When asking to fill the linegap, you're filling that .5em space, what happens at the top and the bottom? Do you add .25em at each? So each line gets .25em of bg above and below? Or just between the lines?<br>
&lt;TabAtkins> nigel: At the moment we don't say.<br>
&lt;TabAtkins> fantasai: Ok, thiat's a really important question to answer in CSS.<br>
&lt;TabAtkins> fantasai: Second question, if two lines have different lengths, what happens?<br>
&lt;Rossen> line-box-margin: collapse<br>
&lt;TabAtkins> nigel: Probably we take whatever answer is most convenient.<br>
&lt;TabAtkins> nigel: But as far as I know you can't set a padding value, because you can't calculate it...<br>
&lt;TabAtkins> fantasai: We should specify that...<br>
&lt;TabAtkins> TabAtkins: Why's it hard? Just the diff between font-size and line-height, right?<br>
&lt;TabAtkins> fantasai: Not quite - the bg area isnt' the size of the line box. The area around an inline - in 2.1 there were two ways to calculate the area, based on font metrics, and impls might do different things.<br>
&lt;TabAtkins> Rossen: This is going a bit off topic, can we bring it back to b-d-b?<br>
&lt;fantasai> s/line box/line height box of the inline that's used for layout/<br>
&lt;nigel> -> https://github.com/w3c/csswg-drafts/issues/814 [css-inline] Define the content area of inline boxes #814<br>
&lt;Rossen> q?<br>
&lt;TabAtkins> TabAtkins: So it sounds like b-d-b: inner-clone badly solves border-radius issues, and limiting it to just background is better solved with a break-padding property?<br>
&lt;fantasai> break-padding also causes problems with border-radius<br>
&lt;TabAtkins> fantasai: So I think those are the main two request from Nigel, this and figuring out the fill-the-gaps issue.<br>
&lt;TabAtkins> fantasai: Which I think is best done by making impls interoperable, then just using padding on the element.<br>
&lt;TabAtkins> fantasai: If we have a consistent box height, then having a line-height of 1.5 and a padding on inline of .25em above and below *should* fix the gap; if it doesn't, we should fix that.<br>
&lt;TabAtkins> fantasai: And for the other issue of cloning spaces - it seems the solution you're proposing doesn't actually solve the problem.<br>
&lt;TabAtkins> fantasai: It's not just "clone most nested"; if there is b-r involved, you want to spam that innermost b-r all the way up, so the lower backgrounds dont' show up underneath the topmost's b-r.<br>
&lt;TabAtkins> Rossen: So yeah, the feature request is something we'll work on, probably as part of Break. We'll go from there!<br>
</details>


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

Received on Friday, 4 August 2017 08:36:26 UTC