- From: Sebastian Zartner via GitHub <sysbot+gh@w3.org>
- Date: Fri, 20 Oct 2023 09:26:11 +0000
- To: public-css-archive@w3.org
Bidi content is definitely hard to handle and may not always provide the best results. Though UAs should try an do their best to output the contents as expected. > Thinking in terms of use cases, this particular feature request seems to be driven by ellipsis in the middle of file names, URLs, serial numbers, and the like. Yes, file paths and URLs were my main use cases. Therefore, I welcome @fantasai's [comment](https://github.com/w3c/csswg-drafts/issues/3937#issuecomment-1644627966) about letting UAs be smart about where to crop the contents. > As for how to implement logical middle-ellipsis.... I'm not sure, exactly, but I think it's at least worth giving it some more thought. Things like counting codepoints are surely not the answer; it has to be based on measurement of (shaped) text. Yes, measurement-based positioning seems reasonable as we need to keep non-textual contents in mind. And as @frivoal pointed out earlier, textual contents may also differ in different aspects. Though I think the spec. is already prepared for that by [saying](https://drafts.csswg.org/css-overflow-4/#:~:text=For%20the%20ellipsis,rather%20than%20ellipsed.) > For the ellipsis and string values, implementations must hide characters and atomic inline-level elements at the applicable edge(s) of the line as necessary to fit the ellipsis/string, and place the ellipsis/string immediately adjacent to the applicable edge(s) of the remaining inline content. The first character or atomic inline-level element on a line must be clipped rather than ellipsed. So, inline contents are layed out and then characters and atomic inline-level elements are stripped off until the ellipsis/string fits. We just need to define that in more detail and specify what "applicable edges" are. Implementation-wise, this probably requires to define an algorithm. Trying to roughly outline one, I'd say: 1. Check whether the contents fit into the the element without any overflow. If they do, output the contents. 2. Strip one character or atomic inline-level element from one of the applicable edges. If there are multiple edges, strip alternating from the first and the second one. For middle-cropping, UAs may define some weighting for when to alternate between the edges. 3. Check whether the ellipsis/string fits. If it does, output the contents and the ellipsis/string. If not, repeat from step 2. Sebastian -- GitHub Notification of comment by SebastianZ Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3937#issuecomment-1772388924 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Friday, 20 October 2023 09:26:13 UTC