Re: [csswg-drafts] [css-overflow] Bidi handling for text-overflow and line-clamp ellipses (#12617)

The CSS Working Group just discussed `[css-overflow] Bidi handling for text-overflow and line-clamp ellipses`, and agreed to the following:

* `RESOLVED: both ellipsis are isolates, treated as a neutral char at the paragraph's embedding level, and take their bidi direction from the paragraph`

<details><summary>The full IRC log of that discussion</summary>
&lt;fantasai> s/Topic/Subtopic/<br>
&lt;TabAtkins> andreubotella: This came up in the review of impl for text-grow/shrink<br>
&lt;TabAtkins> andreubotella: you can set a custom string on block-ellipsis, what happens with bidi<br>
&lt;TabAtkins> andreubotella: for text-overflow, spec implies the text is part of the element's context for text purposes<br>
&lt;TabAtkins> andreubotella: but in existing impls it inherits direction of line<br>
&lt;TabAtkins> andreubotella: in both cases the ellipsis is a bidi isolate<br>
&lt;TabAtkins> andreubotella: but what's the default direction?<br>
&lt;TabAtkins> andreubotella: for text-overflow it presumably inherits from line<br>
&lt;TabAtkins> andreubotella: for line-clamp it says to act like plaintext, based on content<br>
&lt;TabAtkins> andreubotella: this is a spec diff between the two features<br>
&lt;TabAtkins> andreubotella: is it an okay difference? igalia wants to see if it makes sense to consolidate<br>
&lt;florian> q?<br>
&lt;florian> q+<br>
&lt;TabAtkins> andreubotella: or is the bidi handling difference intentional<br>
&lt;astearns> ack fantasai<br>
&lt;TabAtkins> fantasai: I think the right thing is to do text-overflow, treat it as part of the paragraph the line is attached to<br>
&lt;TabAtkins> fantasai: I don't think treating it as plaintext at the epoint where it's at in the nesting structure makes sense<br>
&lt;TabAtkins> florian: are you talking about both, or...<br>
&lt;TabAtkins> fantasai: issue summary says text-overflow treats it as part of the paragraph for bidi purposes<br>
&lt;TabAtkins> andreubotella: I don't remember exact text<br>
&lt;TabAtkins> fantasai: but I do think that's the correct behavior<br>
&lt;TabAtkins> fantasai: it should be part of the paragraph's embedding level<br>
&lt;TabAtkins> andreubotella: in a separate isolate?<br>
&lt;TabAtkins> fantasai: potentially yes<br>
&lt;astearns> ack florian<br>
&lt;TabAtkins> florian: if we do end up on the same answer that's nice, but the two features are different. the way it's specced for block-ellipsis is deliberate, and I think it's right<br>
&lt;TabAtkins> florian: text-overflow is in a weird state in general. what the spec thinks it does is close to Firefox but not identical, and far from Chrome. in many aspect, not just bidi<br>
&lt;TabAtkins> florian: from a spec pov, this is a paint-time operation, not part of the surrounding text. the surrounding text can be scrolled while the ellipsis is painted on top. the ellipsis isn't "inserted", it's floating on top<br>
&lt;TabAtkins> fantasai: that's why using the paragraph's embedding level is good, that won't change as the insertion point moves<br>
&lt;TabAtkins> florian: right. just explaining why the specs are different. one is clearly part of the layout, the other is less clear and might be painted on top<br>
&lt;TabAtkins> fantasai: the block ellipsis does belong to the paragraph, not the surrounding text. so for bidi it should be treated at the paragraph level.<br>
&lt;TabAtkins> andreubotella: for block-ellipsis it creates an isolate and the content of the ellipsis text determines the direction, not the paragraph's content<br>
&lt;TabAtkins> fantasai: I don't think we want that. the ellipsis is usually neutral characters<br>
&lt;TabAtkins> fantasai: and plaintext defaults to ltr if ther'es no strong characters, so the ellipsis will usually do the wrong thing in rtl text<br>
&lt;TabAtkins> fantasai: so that's why I think it needs to take from the paragraph<br>
&lt;TabAtkins> fantasai: whatever text it is that we're "attaching" to<br>
&lt;TabAtkins> fantasai: the style of the text should come from there, and so should the bidi direction. for bidi purposes it should be at the lowest possible embedding level<br>
&lt;TabAtkins> andreubotella: what if the paragraph has unicode-bidi:plaintext?<br>
&lt;TabAtkins> andreubotella: if the paragraph with the ellipsis has plaintext, the embedding level of the para is based on the content of the para. if the ellipsis inherits bidi direction from the para, then inheriting that won't be the same as inheriting from the paragraph<br>
&lt;TabAtkins> fantasai: the q I have is... does the ellipsis originate from its paragraph or the clamping element?<br>
&lt;TabAtkins> florian: the paragraph I think<br>
&lt;TabAtkins> fantasai: consider an LTR document with an rtl quote<br>
&lt;TabAtkins> florian: the block ellipsis is wrapped in an anonymous inline whose parent is the block container's root inline box<br>
&lt;TabAtkins> florian: not the clamping element<br>
&lt;TabAtkins> fantasai: then in that case we should be applying the direction of... hm...<br>
&lt;TabAtkins> florian: reminder, it's specified currently as unicode-bidi:plaintext because you used to think that's the right thing to do<br>
&lt;TabAtkins> fantasai: if plaintext there's two effects. we determine direction from contents, I think that's wrong, it should be from the element setting the string or applying the line clamp<br>
&lt;TabAtkins> fantasai: the other thing it does is it isolates it; for the paragraph it's treated as neutral char.<br>
&lt;TabAtkins> florian: which we do want<br>
&lt;TabAtkins> fantasai: that's probably okay<br>
&lt;TabAtkins> andreubotella: it should definitely be isolate, yes<br>
&lt;TabAtkins> fantasai: even if it's a neutral char it needs to be outside any embeddings in that paragraph; it needs to be participating in the paragraph's base level<br>
&lt;TabAtkins> astearns: if i'm following, this'll apply to both ellipsises?<br>
&lt;TabAtkins> andreubotella: if it's an isolate that inherits from the para, then... that would match Firefox currently for text-overflow:shrink<br>
&lt;andreubotella> s/text-overflow:shrink/text-overflow: &lt;string><br>
&lt;TabAtkins> fantasai: seems reasonable<br>
&lt;TabAtkins> fantasai: making sure I understand. So it is isolated. as an isolate it behaves as a neutral char at the paragraph's embedding level. within the isolate it takes the direction of the paragraph...<br>
&lt;TabAtkins> florian: are you distinguishing between para or block container, or just saying para because it's easier?<br>
&lt;TabAtkins> fantasai: para is the bidi term. block container is what I mean<br>
&lt;TabAtkins> fantasai: it just can't be plaintext because it would almost always be ltr<br>
&lt;TabAtkins> florian: I think that works for block-ellipsis. for text-overflow, treating as a neutral char doesn't "really" do anything since it's floating and not in the text, but that depends on impl. we need one understanding of it someday, we have two<br>
&lt;TabAtkins> iank_: we can just set an override direction on it presumably. i'm probably fine with that<br>
&lt;TabAtkins> astearns: objections?<br>
&lt;TabAtkins> astearns: if anyone wants more time to dig into it<br>
&lt;TabAtkins> RESOLVED: both ellipsis are isolates, treated as a neutral char at the paragraph's embedding level, and take their bidi direction from the paragraph<br>
&lt;TabAtkins> florian: I think I agree but have a doubt<br>
&lt;TabAtkins> florian: for ellipsis that are primarily punct, yes. but if you have text like "to be continued...", you might want to key off the text, and have the punct line up with it correctly<br>
&lt;TabAtkins> florian: if you have an Arabic bit of text, ellipsis is "to be continued..." where do you want the dots<br>
&lt;TabAtkins> florian: you could sort of see it both ways. going with Arabic isn't inherently wrong<br>
&lt;TabAtkins> fantasai: do we have a pseudo for this ellipsis?<br>
&lt;TabAtkins> florian: not currently, but have a note we want one later<br>
&lt;TabAtkins> fantasai: when we do you can set direction<br>
&lt;TabAtkins> florian: I think that's probably right. for the main case, just punct, it's definitely right. for text cases, we can deal with it in the future.<br>
&lt;TabAtkins> fantasai: when block ellipsis happens, what element does the ellipsis come from?<br>
&lt;TabAtkins> florian: the most nested block-level element involved<br>
&lt;TabAtkins> fantasai: then yes I think this i sthe best answer we can do<br>
</details>


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


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 27 January 2026 21:35:08 UTC