Bug 1843252 [wpt PR 41012] - Add tests for Selection.toString() and text-transform...
commitb3f81055d05a72eb504f36404faecfd799dd59ad
authorFrédéric Wang <fwang@igalia.com>
Tue, 16 Jan 2024 17:01:48 +0000 (16 17:01 +0000)
committermoz-wptsync-bot <wptsync@mozilla.com>
Thu, 18 Jan 2024 08:23:27 +0000 (18 08:23 +0000)
treea0ec6b17bd1ed8dced8cabb81d6e8c71788eb544
parent6489a7b8098f05983ae18b7c34a581193a62c6ba
Bug 1843252 [wpt PR 41012] - Add tests for Selection.toString() and text-transform, a=testonly

Automatic update from web-platform-tests
Add tests for Selection.toString() and text-transform (#41012)

* Add tests for Selection.toString() and text-transform

This is a variation of the test added in [1] verifying how selection
works on the single char 'ß' with text-transform: uppercase. This is
special because the transformed text is 'SS' which has length 2. Instead
of using a reftest to check the rendered selection really spans the 2
characters, we use a JS test to directly check the returned value of
Selection.toString().

We generalize this approach to characters that are converted to their
italic equivalent via text-transform: math-auto. Note that for most of
them, the transformed text is a character in the Mathematical
Alphanumeric Symbols block, which is represented as a surrogate pair in
UTF-16. So it has length 2 as a UTF-16 string, although it's really
rendered as one character. The new approach works better than the reftest
approach in order to exhibit Chromium's bug 750990 [2].

A similar test is added for single-char <mi> elements, which perform
the same transformations as math-auto. That way it could work with
browsers implementing this MathML feature without relying on math-auto.

[1] https://chromium-review.googlesource.com/c/chromium/src/+/2987819
[2] https://bugs.chromium.org/p/chromium/issues/detail?id=750990

* Update mathvariant-transforms.py
--

wpt-commits: 97823484f33ffdcd85ebd4657af6433ad7c2c757
wpt-pr: 41012
testing/web-platform/tests/css/css-text/text-transform/math/italic-mapping.js [new file with mode: 0644]
testing/web-platform/tests/css/css-text/text-transform/math/text-transform-math-auto-003.html [new file with mode: 0644]
testing/web-platform/tests/css/css-text/text-transform/text-transform-upperlower-107.html [new file with mode: 0644]
testing/web-platform/tests/mathml/relations/css-styling/mathvariant-auto-selection.html [new file with mode: 0644]
testing/web-platform/tests/mathml/tools/mathvariant-transforms.py