Re: [csswg-drafts] [css-sizing][css-align][css-text] Aligning an aligned block of text within its container

The Working Group just discussed `Outstanding requests from TTML`, and agreed to the following resolutions:

* `RESOLVED: Add a text-group-align property to text 4 with an outline and open issues on that text once it's drafted.`

<details><summary>The full IRC log of that discussion</summary>
&lt;dael> Topic: Outstanding requests from TTML<br>
&lt;dael> github: https://github.com/w3c/csswg-drafts/issues/1975<br>
&lt;dael> fantasai: If you load the first link the first issue you'll get the PDF.<br>
&lt;dael> fantasai: Basic issue is you have a paragraph or a sentence. You put it in a box with a width constraint so it wraps. All the lines of text aren't 100% filled. One is 80% one with 50% full.<br>
&lt;dael> fantasai: You want text left aligned byt the paragraph to be centered in its container.<br>
&lt;dael> fantasai: We can't do this in CSS. TTML would like for us to be able to do this. Different ways to approach it.<br>
&lt;dael> TabAtkins: Line beak is between is and enormous in the example. They want text left aligned but once you have the line breaks center the group and then left align within the established center.<br>
&lt;dael> astearns: Text can do this in a 2 line, they want this in a 3 line scenario<br>
&lt;dael> TabAtkins: And any line might be the longest.<br>
&lt;dael> Rossen: If we have padding auto, that's what they want.<br>
&lt;dael> astearns: Not only centering<br>
&lt;dael> dbaron: Underlying feature is you want to re-shrinkwrap the width of the block and then figure out what to do with it.<br>
&lt;dael> florian: This is a sizing thing or a text effect thing.<br>
&lt;dael> fantasai: If this was laid out with css the left gap would not be here.<br>
&lt;dael> Rossen: You're sure we can't with flexbox?<br>
&lt;dbaron> s/block/block after wrapping lines/<br>
&lt;dael> TabAtkins: Yes. YOu need to re-shrinkwrap after linebreaking and flexbox determines size after linbreaking.<br>
&lt;dael> myles: So you want to layout the first line, figure out the width?<br>
&lt;dael> dbaron: Layout all the lines, figure out which is the longest, and then shrink<br>
&lt;dael> dbaron: You have a size, layout all the line in the size, then change the width of the block smaller so that it's lined up with the widest.<br>
&lt;dael> myles: Does flaots make that real harD?<br>
&lt;dael> dbaron: Probably<br>
&lt;dael> TabAtkins: Solution was a second level of text alignment where it's within the bounds of the longest line. Should be fine with floats, or at least well defined.<br>
&lt;dael> dbaron: You'd have to do work to define what to do with extra bits.<br>
&lt;dael> florian: Driving use case isn't floats driven.<br>
&lt;dael> TabAtkins: And you don't need a second wrapper to get that.<br>
&lt;dael> astearns: You and I TabAtkins have some solution just properties are reverced.<br>
&lt;dael> dbaron: I think what I desc is what browsers did pre-CSS. Like netscape 4 would narrow the backgrounds to make the longest line.<br>
&lt;dael> astearns: To my mind what's happening is here you have a center-left paragraph. We lay it out as if it's left aligned, taking the longest line and centering the whole paragraph. I'm looking similar to text-align-last, I suggested text-align-inner where you say this is acentered paragraph by inner is left.<br>
&lt;dael> floI saw it the other way around.<br>
&lt;dael> astearns: I forgot how TTML asked.<br>
&lt;dael> florian: I htink TabAtkins is better for forward compat. left left is better then fully centered.<br>
&lt;dael> TabAtkins: fantasai pointed out a futher use case when handling some CJK topography where most content-ful should be centered but shorter are justified by the width. Right now you have to size the box with ic unit.<br>
&lt;dael> fantasai: That would solve a complain from CJK that jsutification causes their lines to have space.<br>
&lt;dael> florian: I think there is still advanced CJK alignment, but this gets up most of what they want.<br>
&lt;fantasai>  s/space/too much space/<br>
&lt;dael> myles: This is center-left and you're talking center-justified?<br>
&lt;dael> astearns: this is a text-align: left with a tex-group-align: center<br>
&lt;dael> fantasai: And when there's floats you try to shorten as much as the shortened line.<br>
&lt;fantasai> s/shorten as/shift as/<br>
&lt;dael> florian: For TTML float interuption is unimportant, but in CJK we care.<br>
&lt;fantasai> s/line/line would allow/<br>
&lt;dael> koji: So it's a group?<br>
&lt;dael> fantasai: The question we have to think about is from TTML if we only deal with one block it's probably good enough.<br>
&lt;dael> florian: Per BFC instead?<br>
&lt;dael> TabAtkins: I was assuming 2 paragraphs there were use cases to have them the same. Don't cross BFC bounderies.<br>
&lt;dael> myles: What happens if you put it on one paragraph of BFC><br>
&lt;dael> TabAtkins: It FCs the block or it's ignored because block is not a BFC.<br>
&lt;dael> dbaron: Inherited or non?<br>
&lt;dael> TabAtkins: Non<br>
&lt;dael> myles: Put it on your BFC and hopefully authors knows what a BFC is<br>
&lt;dael> fantasai: I don't think it needs to BFC anything. If we're going to have a block, a section with 2 paragraphs is we want them to be a unit they property has to be non-inherit and when you apply on a section it modifies line box on both sections.<br>
&lt;dael> astearns: More complicated.<br>
&lt;dael> florian: blocka nd to descendencts<br>
&lt;dael> fantasai: You break at BFC bounderies. The block itself doesn't need to be a BFC<br>
&lt;dael> dbaron: It applies to all the lines that are in this block and it's descendent blocks? Only traversing child blocks and not into the lines?<br>
&lt;dael> fantasai: Right.<br>
&lt;dael> dbaron: I feel like scope is similar to first-letter or text-indent for finding things? But those just look at first and this is looking at all?<br>
&lt;dbaron> dbaron: ... never mind text-indent, that's inherited<br>
&lt;dael> astearns: Before we go further into complicating we should ask the TTML people if they want to align paragraphs.<br>
&lt;dael> florian: CJK does<br>
&lt;dael> koji: CJK the whole block is one BFC and then we need to layout everything.<br>
&lt;dael> florian: For CJK case i'm worried about floats.<br>
&lt;dael> TabAtkins: [whiteboards floats]<br>
&lt;dael> TabAtkins: Have big element and a floating picture and some text.<br>
&lt;dael> TabAtkins: This block of lines having a shorter allowed line width is handled separately for the second block?<br>
&lt;dael> Rossen: That would be horrible.<br>
&lt;dael> fantasai: I don't think separate blocks.<br>
&lt;dael> dbaron: Look at the exits, not the lengths.<br>
&lt;dael> florian: floats are aligned to the box<br>
&lt;dael> fantasai: no<br>
&lt;dael> dbaron: So you have some excess on each line, figure out the smallest, and use that for the alignment.<br>
&lt;dael> Rossen: But then add a float o nthe right side.<br>
&lt;dael> dbaron: THere's still excess on each line.<br>
&lt;dael> TabAtkins: Excess you know whichever has the smallest because all the others can be adjustested jsut as much.<br>
&lt;dael> dbaron: Suppose you're crossing multiple blocks and they have different text alignment. You block align it center, and you have a child with right align.<br>
&lt;dael> dbaron: You accumulate excess on both sides and use the smallest from both. I think that's similar. If the left aligns have 0 and the right is whatever is the smallest. If you're then told to center you move the over by that much.<br>
&lt;dael> fantasai: I was thinking alignment after the group alignment. You find out the shortener and then you shrink your line box. Then we center in the remaining space after we apply group alignment.<br>
&lt;dael> dbaron: I think you're right.<br>
&lt;dael> florian: Use cases to make it more complex then TTML wants are CJK. If we're not solving moving the alignement we're not solving CJK.<br>
&lt;dael> astearns: I suuget we design this only at the paragraph level.<br>
&lt;dael> TabAtkins: Won't work if there's floats for CJK. We want the extra shrinkwrapping.<br>
&lt;dael> [everyone talks]<br>
&lt;dael> iank_: We want smartness and things will be complex.<br>
&lt;dael> fantasai: Offset on list is in respect to he edge of the lin with alignment so it'll move with this.<br>
&lt;dael> astearns: Let's get the conversation to one person at a time.<br>
&lt;dael> TabAtkins: I think this needs more design. I don't think we should agree right now, but it's good to get this in fron tof people.<br>
&lt;dbaron> I think the CJK usecase requires the block-level thing that Netscape 4 did.<br>
&lt;dael> fantasai: Before we consider restrict to single paragraph we should hear from TTML to see if it works for them. I think we have agood idea what we want to try and let's see if it works. I would suggest we draft the proposal into Text 4 and work it through as a part of writing.<br>
&lt;dael> astearns: And having sep issues.<br>
&lt;dael> florian: Most solve TTML, nice for CJK<br>
&lt;dael> astearns: Add a text-group-align property to text 4 with an outline and open issues on that text once it's drafted.<br>
&lt;dael> astearns: Obj?<br>
&lt;dael> koji: Early someone mentioned creating an anon block?<br>
&lt;dael> fantasai: I think that's more difficult for the mechanism.<br>
&lt;dael> fantasai: Can you explain the use cases in the issue?<br>
&lt;dael> koji: Yes.<br>
&lt;dael> RESOLVED: Add a text-group-align property to text 4 with an outline and open issues on that text once it's drafted.<br>
&lt;dael> astearns: And we'll talk witht he TTML.<br>
&lt;dael> fantasai: They're looking to edit.<br>
</details>


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

Received on Tuesday, 10 April 2018 14:36:37 UTC