[csswg-drafts] [css-text] Clarification about hunging spaces and max-content size (#4359)

javifernandez has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-text] Clarification about hunging spaces and max-content size ==
The CSS WG resolved recently (issue #3440) that preserved spaces by pre-wrap, if not followed by a forced break, must hang:

https://drafts.csswg.org/css-text-3/#white-space-phase-2
> If white-space is set to pre-wrap, the UA must (unconditionally) hang this sequence, unless the sequence is followed by a forced line break, in which case it must conditionally hang the sequence is instead. 

The above mentioned resolution included a clarification of the concept of hung vs conditionally hung glyph, which regarding this issue implies the following:

https://drafts.csswg.org/css-text-3/#hang
> The hanging glyph is also not taken into account when computing intrinsic sizes (min-content size and max-content size), and any sizes derived thereof. 

So, I wonder whether the following case is covered by the statements described before:

`<div style="font: 20px/1 Ahem; color: green; background: red; width: max-content; white-space: pre-wrap">XX&#x0020;</div>
`

I'm not sure if the concept if "hanging glyph" implies that such glyph would otherwise overflow; at least I don't find that in the definition if hung descried in the link above. This is perhaps the first clarification I'd ask (if that's the case maybe we can add something in the spec about it)

Following what the White Space Processing Phase II states, the trailing space sequence must hang, hence it should not account for the box's max-content size. So, I'd expect no red color will be shown when rendering the example. However, both Firefox and Chrome renders the mentioned example as follows:

![hang-and-maxContent](https://user-images.githubusercontent.com/2230241/65309242-fa6e9900-db8b-11e9-801e-8e4bd9c684ce.png)



Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/4359 using your GitHub account

Received on Friday, 20 September 2019 07:52:40 UTC