Re: [csswg-drafts] [css-inline-3] inline boxes and line-fit-edge vs text-box-trim/edge (#10834)

The CSS Working Group just discussed `[css-inline-3] inline boxes and line-fit-edge vs text-box-trim/edge`, and agreed to the following:

* `RESOLVED: text-box-trim does not change height contribution of inline`
* `ACTION: fantasai to make testcase and report back on WebKit/Chrome implementation status`
* `RESOLVED: if text-box-trim reduces the effective height of the inline box compared to line-fit-edge, that amount is propagated as a negative margin (the same way as a specified negative margin is propagated) to inline descendants`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> https://github.com/w3c/csswg-drafts/issues/10834#issuecomment-2540644321<br>
&lt;kbabbitt> fantasai: problem statement is at (link in chat)<br>
&lt;kbabbitt> ... we have a transparency principle that an unstyled inline should have no effect on layout<br>
&lt;kbabbitt> ... if I have some text in an &lt;em> and insert a &lt;span> that should not affect formatting<br>
&lt;fantasai> &lt;em>Some text&lt;/em> vs &lt;em>&lt;span>Some text&lt;/span>&lt;/em> must be identical<br>
&lt;kbabbitt> ... that means properties need to be inherited if they affect inline layout<br>
&lt;kbabbitt> ... q is what does text-box-trim do on inlines<br>
&lt;kbabbitt> ... backgrounds and bortders on inlins traditionally do not affect layout and that's fine<br>
&lt;kbabbitt> ... we also talked about text-box-trim impacting height of line on an inline<br>
&lt;joshtumath> s/bortders/borders/<br>
&lt;kbabbitt> ... my conclusion is I don't think we should do that<br>
&lt;kbabbitt> ... because if we set text-box-trim on an inline, e.g. on a span, that will affect the line height because the inner element now has a taller height<br>
&lt;kbabbitt> ... I think we have to specify that when we are in default line height mode, text-box-trim can change how backgrounds and borders are drawn<br>
&lt;kbabbitt> ... but it does not change the height contribution of the inline<br>
&lt;kbabbitt> ... which remains based on line-height property<br>
&lt;kbabbitt> astearns: dbaron commented on different effects on blocks and inlines<br>
&lt;kbabbitt> fantasai: we have a distinction, it's called line-fit-edge<br>
&lt;kbabbitt> ... that's a separate property which allows it to trim<br>
&lt;kbabbitt> ... Proposal Part A: text-box-trim does not change height contribution of inline<br>
&lt;dbaron> Part A sounds good to me<br>
&lt;kbabbitt> Proposed: text-box-trim does not change height contribution of inline<br>
&lt;kbabbitt> RESOLVED: text-box-trim does not change height contribution of inline<br>
&lt;kbabbitt> fantasai: next part: we have a line-fit-edge property; it changes to a new inline layout model<br>
&lt;kbabbitt> ... where instead of using line-height as height contribution, we use margin box edge<br>
&lt;kbabbitt> ... in addition, it also lets you control which edge you use, effectively setting default edge to be used<br>
&lt;kbabbitt> ... and that inherits<br>
&lt;kbabbitt> ... what we could do is have a negative margin<br>
&lt;kbabbitt> ... negative margin ran into this transparency issue<br>
&lt;kbabbitt> ... to solve it, we said negative margin is propagated to descendant of inline box<br>
&lt;kbabbitt> ... if we say text-box-trim is applied to this box and changes where borders and padding are drawn, then it should correspondingly affect height contribution<br>
&lt;kbabbitt> ... but since it doesn't inherit, we somehow need to propagaste<br>
&lt;kbabbitt> ... in the same way as a negative margin would be<br>
&lt;kbabbitt> ... Proposal is that, in this mode, the amount by which text-box-trim reduces margin box is propagated as a negative margin<br>
&lt;kbabbitt> astearns: is this propagation of negative margins a new thing?<br>
&lt;fantasai> PROPOSAL: if text-box-trim reduces the effective height of the inline box compared to line-fit-edge, that amount is propagated as a negative margin (the same way as a specified negative margin is propagated) to inline descendants<br>
&lt;kbabbitt> fantasai: the line-fit-edge negative margin is a new thing, yes<br>
&lt;kbabbitt> astearns: concerned this new thing may have side effects<br>
&lt;kbabbitt> dbaron: Right now we already have these rules for special proagation of negative margins when you have line-fit-edge in non-default value<br>
&lt;kbabbitt> ... proposal is that, when you use text-box-trim, in this case where line-fit-edge has non-default value, then negative margin gets propagated to descendants? in addition to other negative margin?<br>
&lt;kbabbitt> fantasai: yes<br>
&lt;kbabbitt> dbaron: I think this makes sense, but we need to think about the line-fit-edge model some more and test it some more<br>
&lt;kbabbitt> ... but this proposal does seem to make sense to me<br>
&lt;kbabbitt> fantasai: agree 100%<br>
&lt;kbabbitt> astearns: Restating: the effect of text-box-trim contributes to the negative margin that is assessed when line-fit-edge is non-default and propagates to descendants<br>
&lt;kbabbitt> fantasai: correct<br>
&lt;kbabbitt> astearns: Not sure I understand repercussions, need to take a deep look at this, but I'm fine with resolving on this<br>
&lt;kbabbitt> chrishtr: re: first resolution: is normal the default?<br>
&lt;kbabbitt> fantasai: yes<br>
&lt;kbabbitt> chrishtr: does that have an effect on chromium/webkit implementation of [missed]<br>
&lt;dbaron> s/[missed]/text-box-trim/<br>
&lt;kbabbitt> fantasai: I haven't tested that, not sure what implementations are doing<br>
&lt;kbabbitt> ... but it's only on inline boxes<br>
&lt;kbabbitt> chrishtr: could you take an action item to take on that?<br>
&lt;fantasai> ACTION: fantasai to make testcase and report back on WebKit/Chrome implementation status<br>
&lt;kbabbitt> chrishtr: bonus points for a WPT<br>
&lt;kbabbitt> Proposed: interaction between line-fit-edge and text-box-trim contributes to a negative margin that is propagated to inline descendants<br>
&lt;fantasai> RESOLVED: if text-box-trim reduces the effective height of the inline box compared to line-fit-edge, that amount is propagated as a negative margin (the same way as a specified negative margin is propagated) to inline descendants<br>
</details>


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


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

Received on Wednesday, 8 January 2025 17:19:00 UTC