Re: [csswg-drafts] [css-inline] initial-letter should be clearer about how it makes its block taller

The CSS Working Group just discussed `spacing above initial letters`, and agreed to the following:

* `RESOLVED: If the initial letters container has no border or padding then the glyph content above the alignment point for initial letter is not considered for layout.`
* `RESOLVED: Note to be added that the default behavior may change in the future.`
* `RESOLVED: The margin box of the initial letter must be inside the content box of its container.`
* `RESOLVED: Add an example that shows default overlap`
* `RESOLVED:  initial letter does not increase the height of the line box`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> Topic: spacing above initial letters<br>
&lt;eae> fantasai: Spacing above initial letters<br>
&lt;fantasai> github: https://github.com/w3c/csswg-drafts/issues/719<br>
&lt;eae> dauwhe: We've been trying to sort our issues around spacing around initial letters.<br>
&lt;eae> ...this gets somewhat complicated especially as it can have ascenders and marks extending outside. runs the risk of overlap. Something had to be done. The idea is to define boxes that helps us explain initial letter.<br>
&lt;eae> dauwhe: One is visual box which is the bounding box without padidng and borders.<br>
&lt;eae> ...you see at the bottom here and initial letter and the acsent mark extends outside.<br>
&lt;eae> dauwhe: Initial letters have alignment requirementss<br>
&lt;eae> jensimmons: are these diagrams explanations of what we have in the spec or what you are proposing?<br>
&lt;eae> fantasai: What's the relationship between the top of intial letter and the top of where it's placed.<br>
&lt;eae> fantasai: If you have a paragraph and the second paragraph with an intial letter, has to ensure enough space between the two. We don't want content to overlap. We don't want to add too much space or it'll look bad.<br>
&lt;eae> fantasai: Intiial letter spec has a lot around how letter is aligned with other content in the paragraph and talks about how the bottom edge is aligned. Sometimes there is a decender, if there is a second line we don't want the decender to blend into the second line. Open questions around the top.<br>
&lt;eae> fantasai: Such as a border or the previous paragraph. Trying to answere the question about how to create space around the top,<br>
&lt;eae> dauwhe: We have the spacing box, no padidng and border, same as the visual box. It there is padding and border we have the union, taking the larger of the physical box and the border box, hopefully becauses clearer with some examples.<br>
&lt;eae> dauwhe: We have four cases depeneing on padding border on the intial letter itself or the containing box.<br>
&lt;eae> florian: This is initial letters 3<br>
&lt;eae> dbaron: Can we not have margin collapsing?<br>
&lt;eae> iank_: That bit is pretty magical<br>
&lt;eae> florian: Isn't most of the dread around marging collapsing around margin collapsing through, which we're not doing here? Should be fine?<br>
&lt;eae> iank_: This introduces what looks like marging collapsing for inlines, which we do not do today<br>
&lt;eae> jensimmons: margin collapsing where you remove the ability for authors to remove margins?<br>
&lt;eae> dbaron: The container is a block which cna have margin collapsing with many things already<br>
&lt;jensimmons> s/remove/use<br>
&lt;eae> dauwhe: Case 4a, no border or padding on initial letter or contianing block.<br>
&lt;eae> iank_: This is avoiding something earlier in the tree without a border?<br>
&lt;eae> iank_: Say the previous box, nested five times in, has a border. Is it shifting down to avoid that border?<br>
&lt;eae> florian: This is collapsing the acsender with the margin<br>
&lt;eae> iank_: This is participating in margin collapsing?<br>
&lt;eae> fantasai: Yes, we're not going to get sensible results if we don't do that.<br>
&lt;eae> fantasai: We sent margins on our paragraphs to get enough space between our paragraphs. If there is acsent authors don't want to create more space if it fits within the declared margin.<br>
&lt;eae> fantasai: That is not what you typographically want.<br>
&lt;eae> florian: In the example currently on the screen you wouldn't be able to tell them apart.<br>
&lt;eae> fantasai: If you have sections which don't start on their own page, which happens often, and you're expecting three lines worth of spacing between secitons you want that to always be three lines worth, regardless of ascents on the intial cap. Also want to make sure it doesn't overlap with the previous section if it is taller, so needs to be able to extend the margin.<br>
&lt;eae> dbaron: My worry about this is that ir probably more than doubles the engineering complexity of initial letter. Adding margin collapsing, my gut feeling, is at least 2x the engineering cost.<br>
&lt;eae> dbaron: it's more stuff, nothing in initial letter was all that complicated, was a relatively simple feature up until now. Margin collapsing is very complicated and performance sensitive.<br>
&lt;eae> astearns: Is it possible to have a solution without margin collapsing solving the non-overlap case.<br>
&lt;eae> fantasai: Would require you as an author to know the distance between cap-height of glyph and glyph bounding box. Would work but be font specific.<br>
&lt;eae> dauwhe: ...and authors would have to do it for each letter<br>
&lt;eae> ???: The acsent is sticking out of the box, why is this different from any other case where text is outside it's layout box?<br>
&lt;astearns> s/???/myles__ /<br>
&lt;eae> fantasai: In this case we potentially have a lot of extra content outisde of the box. Could say that we don't care if we overlap the ink with the previous line.<br>
&lt;eae> florian: Latin scrips don't stack up a lot, other writing modes have cases where there is a lot of stacking and potentially more ink overlap<br>
&lt;eae> florian: lineheight often reserves space for this, in this case we align with the top of the bounding box so anything that reaches out reaches out far<br>
&lt;eae> myles__: My response to fantasis point, by default in css, we overflow and don't clip.<br>
&lt;eae> fantasai: By default we try not to have it be unreadable<br>
&lt;eae> TabAtkins:  Can and should do it as a generic case where you never have acsents running into previous content. Would make initial letter simpler if it wasn't a part of initial letter<br>
&lt;eae> fantasai: If we were to do it for text in general we'd take a different approach.<br>
&lt;eae> florian: You don't want to do it in a small feature<br>
&lt;eae> fantasai: You're more likely to run into problems here, it's a bigger chunk of ink that would overlap than a normal line of text<br>
&lt;eae> fantasai: People don't tend to run into this for normal text and writing systems with more stacking tends to have a taller line height.<br>
&lt;eae> TabAtkins: Can we settle on a simpler model that pushes it down to avoid ink overlap?<br>
&lt;eae> fantasai: In that is likely to be less of a problem, have it overlap, and have authors fix it, rather than introduce extra spacing.<br>
&lt;eae> TabAtkins: I like it<br>
&lt;eae> astearns: Do we want to raise an issue around dealing with this problem in a generic case?<br>
&lt;eae> fantasai: Case of line boxes is a little different. With lines of actual text rhythm is important and the text is smaller. Not convinced that you'd want to have the same solution.<br>
&lt;eae> astearns: Is there anything with meaning in this proposal for initial letter?<br>
&lt;eae> fantasai: I think it's really a question of how, if the working group objects, it puts a strict constraint in what we can do.<br>
&lt;eae> iank_: I think people are going to need implementation experience to see how much work this would be. IF David is saying this will be complex that scares me.<br>
&lt;eae> florian: Should we put a note in the spec about that?<br>
&lt;eae> florian: Do we specify the behavior as described, overlap with preceding content, and also put in a note explaining the thing dauwhe presented and say "this is what we really want, if you want to implement go ahead"<br>
&lt;eae> iank_: The only thing that scares me there is that for some implementation this would be easy, for others hard.<br>
&lt;eae> astearns: Clarify in spec what would happen with insufficient margin.<br>
&lt;eae> fantasai: We would have to be clear that proposals add but don't change behavior<br>
&lt;eae> dbaron: I'd be curious if other implementors have same reaction as I as with regards to margin collapsing complexity. Another example, what if you have a float that is anchored within the block with the initial letter but before the initial letter, how does the collapse of the margin influence the tentative collapse of the float?<br>
&lt;fantasai> s/proposals add but don't change behavior/the proposal being considered changes behavior, not just adding a new feature (switch)/<br>
&lt;eae> iank_: In our current layout implementation there is no way we could implement this sanely. In our new one, maybe. I agree, very complex<br>
&lt;eae> futhark: If you have an imaginary margin for the initial letter collapsing as if it was a block, if you change the font, you'd reflow and layout the text before we know the margin.<br>
&lt;eae> dbaron: In the presence of floats you don't know if the initial letter is at the top of the box as the float might push it lower. A lot of complexity<br>
&lt;eae> iank_: Super scary!<br>
&lt;eae> astearns: Sounds like we're not willing to make any changes to the current spec<br>
&lt;eae> fantasai: We need to agree on some desired behavior. what behavior we're going for.<br>
&lt;eae> myles__: My proposal would be to use the layout box of the glyph for the layout behavior and not consider the bounding box<br>
&lt;eae> astearns: What I remember you saying,  don't move the content down.<br>
&lt;eae> fantasai: Would lead to more correct behavior in most cases, much more tangible than the alternative. If we went with the other approach, where acsenders take up space, authors will have to compensate with negative margin per glyph. We'll never be able to go back and fix it.<br>
&lt;eae> fremy: If you draw a border around it then everything needs to fit inside of it.<br>
&lt;eae> fantasai: inline blocks are layed out differently from inlines.<br>
&lt;eae> koji: if the glyph overflows the inline block that doesn't work<br>
&lt;eae> fantasai: cap-height is used for sizing and positing of the initial letter.<br>
&lt;eae> fantasai: only if cap-height is the alignment used<br>
&lt;eae> fantasai: Doesn't dictate the size of the initial letter box, includes ascent<br>
&lt;eae> fantasai: Initial letter box by default size to the bounding box. Glyph bounding box would have a lot of extra space around it.<br>
&lt;eae> koji: Davids proposal is very simlar to this<br>
&lt;eae> fantasai: Does not change how inline boxes background are is painted. Here the background area of that box coinsides with the gklyph  bounding box<br>
&lt;eae> ???: What is meant to happen when you don't have as many lines of text as the height of the intial letter?<br>
&lt;eae> fantasai: Defined in spec, clearing. The intial letter is part of the first line, everything below that is an exclusion area, everything will wrap around it, even if it is the next block. Like how floats work.<br>
&lt;myles__> s/???/heycam/<br>
&lt;eae> heycam: The exclusion area also includes the decenders?<br>
&lt;eae> fantasai: There isn't anything special about it. It's all below the first line, all exclusion area.<br>
&lt;eae> iank_: If you have two paragraphs and they're nested. what happens them?<br>
&lt;eae> fantasai: If one of them is a BFC then BFC might get narrower, not sure.<br>
&lt;eae> fantasai: The proposal on the table, if border or padding is used then the initial letter must be contained within the paragraph.<br>
&lt;eae> astearns: If the initial letters container has no border or padding then the glyph content above the alignment point for initial letter is not considered for layout?<br>
&lt;eae> astearns: Objections?<br>
&lt;eae> dauwhe: In general, content area includes everything up to acsent, why did you phrase it as you did?<br>
&lt;eae> florian: Acsent might be too height for some fonts.<br>
&lt;florian> s/florian/fantasai/<br>
&lt;fantasai> s/height/high/<br>
&lt;eae> astearns: Second option, that fantasai was against. If we assume that the author would add enough space to avoid overlap that would require negative margin and by font specific.<br>
&lt;eae> fantasai: You could have more slack there, with the negative margin approach it's more strict, different amount of space per character, per font. The negative margin is specific to the font and the glyph, really bad.<br>
&lt;eae> astearns: dauwhe are you okay with default to overlap?<br>
&lt;eae> dauwhe: I'm totally fine with that, majority of use-cases would not be affected. Would only apply to a minority of content.<br>
&lt;eae> astearns: Any other objecitons?<br>
&lt;eae> RESOLVED: If the initial letters container has no border or padding then the glyph content above the alignment point for initial letter is not considered for layout.<br>
&lt;myles__> ("alignment point" usually means "cap height")<br>
&lt;eae> RESOLVED: Note to be added that the default behavior may change in the future.<br>
&lt;fantasai> the margin box of the initial letter must be inside the content box of its container<br>
&lt;eae> RESOLVED: The margin box of the initial letter must be inside the content box of its container.<br>
&lt;eae> astearns: Any other initial letter topics?<br>
&lt;eae> fantasai: Going back to dbarons initial question. Be clear about whether it is created space between the top of the first line and the container. Whether the line box itself is increased or if a different kind of height is added?<br>
&lt;fantasai> dbaron points out it is detectable by how vertical-align: top behavies: if the item is aligned to the top of the first line or to the top of the raised cap<br>
&lt;astearns> RESOLVED: Add an example that shows default overlap<br>
&lt;fantasai> I think in Sydney we decided the top of the first line minus the raised cap, so suggest we resolve on that<br>
&lt;fantasai> proposed resolution: initial letter does not increase the height of the line box<br>
&lt;eae> astearns: what mechanism pushes everything down then?<br>
&lt;eae> fantasai: The initial letter itself is able to take up space. The initial letter box itself takes up space.<br>
&lt;eae> astearns: Does that satisfy your question David?<br>
&lt;eae> dbaron: Could you say what you proposed yourself again?<br>
&lt;eae> RESOLVED:  initial letter does not increase the height of the line box<br>
&lt;eae> fantasai: I think that's it for initial letter. We have other inline layout stuff.<br>
</details>


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

Received on Monday, 22 October 2018 18:39:46 UTC