Repository navigation
[css-overflow-4] nowrap and block-ellipsis #12811
Description
Forked from #12008, which is mostly about white space collapsing and block-ellipsis. This one will be about block-ellipsis and text-wrap: nowrap (and white-space: nowrap and white-space: pre, which imply text-wrap: nowrap).
@andreubotella said:
There's also the fact that the block-ellipsis spec text allows inserting the ellipsis in the middle of text-wrap: nowrap text, since it only talks about finding the last soft wrap opportunity, and nowrap does not remove wrap opportunities, it just prevents wrapping. Given that, the question comes up of how trailing whitespace would work before the ellipsis inside white-space: pre text. If we just say to collapse as usual according to phase II, and then add the ellipsis, we would still have spaces between the end of the word and the ellipsis in white-space: pre text. Do we want that?
@frivoal said:
For « nowrap does not remove wrap opportunities, it just prevents wrapping » I suspect that can be changed, and have the definition of text-wrap-mode: nowrap say that it suppresses opportunities. In that case, yes, if the whole line (or the whole block) is set to nowrap, then that means you cannot insert the ellipsis in the middle of the line, and you either have to tack it at the very end—including after preserved spaces if any—if there's room, or have to remove the whole line to make room if there isn't, but that seems appropriate: if the content is indivisible, it is indivisible.
@andreubotella said:
We can probably say "soft wrap opportunities were breaking would be allowed (i.e. not text-wrap: nowrap)" without needing to change css-text.
@andreubotella said:
IIUC, if there's a forced line break inside text-wrap-mode: nowrap text and there's remaining space to put the ellipsis without overflowing, then the ellipsis gets inserted at the end; otherwise, the line gets displaced by the ellipsis, right?
@frivoal said:
If text-wrap-mode: nowrap is set on the whole line (or more), yes, that's my understanding.
It seems we are converging on the idea that, current ambiguous phrasinng non withstanding, if we're under a nowrap situation, then the block ellipsis also has no insertion point, and either it fits without removing anything, or it needs to remove the whole line.
Activity
Mark as tentative
Mark as tentative
css-meeting-bot commentedon Sep 17, 2025
The CSS Working Group just discussed
[css-overflow-4] nowrap and block-ellipsis, and agreed to the following:RESOLVED: clarify the interaction between nowrap and block elipssisThe full IRC log of that discussion
<ydaniv> florian: there seems to be some ambiguity about text spec<ydaniv> ... when you remove content next to elipsiss it should disappear
<ydaniv> ... up to the next soft wrap oppertunity
<ydaniv> ... but the way the white space is currently specified, nowrap and pre do not supress it
<ydaniv> ... so reading it says that even if it says nowrap they do not suppress the wrapping oppertunity, just not to take them for line break processing
<ydaniv> ... so literal reading would have it do something else
<ydaniv> ... proposal is to not do that, and leave to the editor to find exact spec wording, and confirm that when you can't wrap you remove the whole thing to insert the elipsiss
<ydaniv> andreubotella: if you have a forced line break inside pre or nowrap then it forces to <missed>
<florian> andreubotella: and there is enough room at the end of the line to fit the ellipsis, that is allowed
<ydaniv> ... only when it doesn't fit and you try to find next oppertunity it tries to find it
<florian> andreubotella: it's only when the ellipsis doesn't fit and you're looking for a previous placement point that nowrap would require removing the whole content
<ydaniv> astearns: so editorially if not specified, could spec editor specify that?
<ydaniv> ... is there some reason why nowrap is specified that way?
<ydaniv> florian: my suspision is editorial accident
<ydaniv> astearns: proposed resolution is to clarify the interaction between nowrap and block elipssis
<astearns> ack fantasai
<ydaniv> fantasai: I would prefer to define this on the line clamp side
<ydaniv> ... that opportunities don't exist unless we need to know where they are for other reason
<ydaniv> ... say it ignores them with in nowrap
<ydaniv> astearns: that's the safeset, wondering if it's enough
<ydaniv> fantasai: question whether the information is there and can be accessed
<ydaniv> florian: I think editors can take that, since me and fantasai are editors we could
<ydaniv> astearns: objections?
<ydaniv> ... none
<ydaniv> RESOLVED: clarify the interaction between nowrap and block elipssis
[css-overflow-4] Clarify interaction between block-ellipsis and nowrap
Tests for block-ellipsis and nowrap
frivoal commentedon Sep 18, 2025
tests at web-platform-tests/wpt#54917
Tests for block-ellipsis and nowrap
Bug 1988965 [wpt PR 54869] - Reclassify block-ellipsis as tentative o…
Bug 1989289 [wpt PR 54917] - Tests for block-ellipsis and nowrap, a=t…
[line-clamp] Don't insert the line-clamp ellipsis inside nowrap text
[line-clamp] Don't insert the line-clamp ellipsis inside nowrap text
[line-clamp] Don't insert the line-clamp ellipsis inside nowrap text
[line-clamp] Don't insert the line-clamp ellipsis inside nowrap text
Bug 1992170 [wpt PR 55181] - [line-clamp] Don't insert the line-clamp…
Bug 1992170 [wpt PR 55181] - [line-clamp] Don't insert the line-clamp…
Bug 1992170 [wpt PR 55181] - [line-clamp] Don't insert the line-clamp…
Bug 1992170 [wpt PR 55181] - [line-clamp] Don't insert the line-clamp…
Mark as tentative
Tests for block-ellipsis and nowrap
[line-clamp] Don't insert the line-clamp ellipsis inside nowrap text