[csswg-drafts] [css-text-4] SVSes should be considered when classifying punctuations (#13204)

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

== [css-text-4] SVSes should be considered when classifying punctuations ==
Standardized variation sequences should be considered when classifying punctuations (fullwidth/halfwidth, cornered/centered).

In [UAX #11: East Asian Width](https://www.unicode.org/reports/tr11/):

> **[4.3 Variation Sequences](https://www.unicode.org/reports/tr11/#VariationSequences)**
>
> In some cases, variation sequences have been defined that request a character to be displayed as wide or narrow. These variation sequences are defined in StandardizedVariants.txt [[StandardizedVariants](https://www.unicode.org/reports/tr41/tr41-36.html#StandardizedVariants)] in the [[UCD](https://www.unicode.org/reports/tr41/tr41-36.html#UCD)], but they are identified via the description of the intended glyph style and not via a formal property of the variation sequence. Nevertheless, the presence of the respective variation selector should be considered a sufficient condition to resolve ambiguous width to either wide or narrow, perhaps subject only to availability in the actual font used. If the font does not have a wide form, a variation sequence requesting the wide form would be ignorable and it makes no sense to treat the character as “Wide” if it is being displayed as “Narrow.”

> **[5 Recommendations](https://www.unicode.org/reports/tr11/#Recommendations)**
>
> …
>
> **Note:** Some variation sequences may specify a narrow or wide presentation behaviour. (This can be true for sequences defined in StandardizedVariants.txt [[StandardizedVariants](https://www.unicode.org/reports/tr41/tr41-36.html#StandardizedVariants)] in the [[UCD](https://www.unicode.org/reports/tr41/tr41-36.html#UCD)] or in emoji-variation-sequences.txt in [[UTS51](https://www.unicode.org/reports/tr41/tr41-36.html#UTS51)].) For such sequences, the width behaviour specified by a variation sequence can differ from the East_Asian_Width property of the base character of that variation sequence. The width indication of the variation sequence can specify some aspects of glyph appearance such as advance width, while not specifying other aspects of presentation, such as rotational behavior in vertical text.

Some variation sequences are as follows (image from [Source Han Sans](https://github.com/adobe-fonts/source-han-sans) [readme file](https://github.com/adobe-fonts/source-han-sans/raw/release/SourceHanSansReadMe.pdf)):

<img width="1027" height="906" alt="Image" src="https://github.com/user-attachments/assets/5fd66f80-fca8-4397-a606-324e1549188b" />

The current CSS specification does not mention SVSes, nor do browsers handle them correctly. On Chrome 143:

```html
<ol>
  <li>
    <!-- `text-spacing-trim` succeeds -->
    测试“测试<mark>”</mark><mark>“</mark>测试”测试
  </li>
  <li>
    <!-- `text-spacing-trim` fails -->
    测试“&#xFE01;测试<mark>”&#xFE01;</mark><mark>“&#xFE01;</mark>测试”&#xFE01;测试
  </li>
  <li>
    <!-- to make sure that SVSes are effective -->
    测试“&#xFE00;测试”&#xFE00;“&#xFE00;测试”&#xFE00;测试
  </li>
</ol>
<ol>
  <li>
    <!-- `text-spacing-trim` succeeds -->
    测试<mark>:</mark><mark>(</mark>测试
  </li>
  <li lang="zh-Hant-TW">
    <!-- `text-spacing-trim` succeeds -->
    测试<mark>:</mark><mark>(</mark>测试
  </li>
  <li>
    <!-- `text-spacing-trim` fails -->
    测试<mark>:&#xFE01;</mark><mark>(</mark>测试
  </li>
</ol>
```

```css
:root {
  font-family: 'Source Han Sans SC';
  font-feature-settings: 'locl';
}
mark {
  background-color: aqua;
}
mark + mark {
  background-color: yellow;
}
```

<img width="457" height="347" alt="Image" src="https://github.com/user-attachments/assets/40b993a5-f469-4fab-989b-83ab506c153f" />

[Interactive test](https://w3c.github.io/i18n-tests/exploratory/index.html?text=%3Col%3E%0A%20%20%3Cli%3E%0A%20%20%20%20%3C!--%20%60text-spacing-trim%60%20succeeds%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%E2%80%9C%E6%B5%8B%E8%AF%95%3Cmark%3E%E2%80%9D%3C%2Fmark%3E%3Cmark%3E%E2%80%9C%3C%2Fmark%3E%E6%B5%8B%E8%AF%95%E2%80%9D%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%20%20%3Cli%3E%0A%20%20%20%20%3C!--%20%60text-spacing-trim%60%20fails%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%E2%80%9C%26%23xFE01%3B%E6%B5%8B%E8%AF%95%3Cmark%3E%E2%80%9D%26%23xFE01%3B%3C%2Fmark%3E%3Cmark%3E%E2%80%9C%26%23xFE01%3B%3C%2Fmark%3E%E6%B5%8B%E8%AF%95%E2%80%9D%26%23xFE01%3B%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%20%20%3Cli%3E%0A%20%20%20%20%3C!--%20to%20make%20sure%20that%20SVSs%20are%20effective%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%E2%80%9C%26%23xFE00%3B%E6%B5%8B%E8%AF%95%E2%80%9D%26%23xFE00%3B%E2%80%9C%26%23xFE00%3B%E6%B5%8B%E8%AF%95%E2%80%9D%26%23xFE00%3B%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%3C%2Fol%3E%0A%3Col%3E%0A%20%20%3Cli%3E%0A%20%20%20%20%3C!--%20%60text-spacing-trim%60%20succeeds%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%3Cmark%3E%EF%BC%9A%3C%2Fmark%3E%3Cmark%3E%EF%BC%88%3C%2Fmark%3E%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%20%20%3Cli%20lang%3D%22zh-Hant-TW%22%3E%0A%20%20%20%20%3C!--%20%60text-spacing-trim%60%20succeeds%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%3Cmark%3E%EF%BC%9A%3C%2Fmark%3E%3Cmark%3E%EF%BC%88%3C%2Fmark%3E%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%20%20%3Cli%3E%0A%20%20%20%20%3C!--%20%60text-spacing-trim%60%20fails%20--%3E%0A%20%20%20%20%E6%B5%8B%E8%AF%95%3Cmark%3E%EF%BC%9A%26%23xFE01%3B%3C%2Fmark%3E%3Cmark%3E%EF%BC%88%3C%2Fmark%3E%E6%B5%8B%E8%AF%95%0A%20%20%3C%2Fli%3E%0A%3C%2Fol%3E&css=%3Aroot%20%7B%0A%20%20font-family%3A%20'Source%20Han%20Sans%20SC'%3B%0A%20%20font-feature-settings%3A%20'locl'%3B%0A%7D%0Amark%20%7B%0A%20%20background-color%3A%20aqua%3B%0A%7D%0Amark%20%2B%20mark%20%7B%0A%20%20background-color%3A%20yellow%3B%0A%7D&lang=zh-Hans-CN&fontSize=20&fontFamily=Source%20Han%20Sans%20SC&width=300&height=240&a=&i=Make%20sure%20you%20installed%20the%20latest%20Source%20Han%20Sans%20SC%20(not%20region%20specific%20subset).)

Related Issues: https://github.com/w3c/clreq/issues/637

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


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

Received on Wednesday, 10 December 2025 20:16:06 UTC