Re: [csswg-drafts] [css-inline] vertically align to nth-child

Thanks so much for your response, @tabatkins. I'm sorry for the long delay. I wanted to get some feedback from other CG members but I had to skip two meetings.

To add some comments from mainly a MathJax point of view.

What you describe would work out well from our point of view, i.e., to have something that marks a container whose baseline will be determined by one of its children, together with a mark on the child that is the one to use for the baseline.

The answer to your question would be yes: in the fraction example, the item to use for the baseline would have to be the fraction line, as suggested. 

Another important case is the one for under-over constructions, e.g., a sum with limits on top and bottom (e.g., [the Cauchy-Schwartz equation](https://en.wikipedia.org/wiki/Cauchy%E2%80%93Schwarz_inequality#Rn_.28n-dimensional_Euclidean_space.29)).  In that case, we would need to be able to use the middle element for its baseline.

To add some context beyond the simple case (though I realize that I risk causing confusion so please feel free to disregard the rest).

Another case to consider is the situation, where a large, stretchy delimiter (parenthesis, brace etc) is placed around a (large) expression (again, e.g., Cauchy-Schwartz). Here, we would want the baseline to be that of the middle piece not whatever construct is needed for the left and right delimiter (we would also want them to be centered on the math axis which is about .25em above the baseline but that's perhaps another topic). We don't know how to do that without knowing the actual height of the delimiters, defeating the purpose of having automatically stretchy constructions (which is actually doable nowadays). It would be great to be able to make a box containing the left delimiter, the main content, the right delimiter (say a flex-box with the left and right pieces stretching to the height and depth of the container), and have the container use the baseline of the middle piece (ignoring the others).

A different example is a horizontal shift to the top and bottom so that they can be centered, but shifted. This is needed to handle italic correction, like for an integral sign where the limits are placed above and below:  they should be centered, but not directly over the integral; the top is shifted to the right, while the bottom is shifted to the left.  The bounding box of the entire expression needs to take these shiftings into account properly.  I haven't been able to work out a decent way to handle that without knowing the exact widths of the three pieces.

Anyway, this is just to point out that a vertical stack is not the only time that being able to specify whose baseline to use would be a valuable asset.


-- 
GitHub Notification of comment by pkra
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1339#issuecomment-308483108 using your GitHub account

Received on Wednesday, 14 June 2017 16:19:39 UTC