Re: [csswg-drafts] [css-text] white-space collapse at end of line: test case and queries

So, agree the spec could be clarified on this point. As for clarifying to which behavior...

The behavior should definitely be symmetric between the start and end edges: both because it's more consistent (especially in consideration of all `text-align` values), and because the spec does use identical wording for both edges and so clearly intended symmetry. Given that we trim through the inlines on the start edge in all implementations, and in the end edge in 50% of not-nonsensical implementations, it seems like converging on trimming through the inlines has a little more weight implementation-wise. (Also Edge for some reason doesn't measure the space that it preserves in this case; try shrinkwrapping the `<div>` around the text and watch it overflow--so it needs some fixing anyway.)

Another line of argument is that unstyled inline boxes are generally expected to have no effect on rendering, and that one inline boundary (end of inline) shouldn't behave any differently than two (start and end of empty inline). So there's a strong argument that unstyled inline boundaries should not affect white space trimming at the end of the line, and in fact this is what happens in Gecko and Edge. In considering the testcase in which they are styled: while adding margins/padding/border might be expected to have an effect on things like text shaping and positioning, it seems odd for them to have an effect on the contents of the text string being rendered, particularly given they're not considered anywhere else in text transformations.

And lastly there's the point that trailing spaces just look bad, and that having a space just inside the closing tag of an inline or before a `<br>` is a reasonably common unintentional markup pattern that shouldn't have a bad effect on rendering. The preserved trailing space becomes noticeable both when the inline is styled, as in the example given by @palemieux, and also when we chose text alignments other than `start`. This gives a real-world use case indicating a preference for Firefox's behavior.

So altogether, I'd say, we should clarify the spec to say that white space trimming at the start and end of the line operates through any inline box boundaries.

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

Received on Monday, 5 March 2018 13:56:12 UTC