[js][py] Capitalize non-Latin text in the getVisibleText atom (#17964)
* [js][py] Capitalize non-Latin text in the getVisibleText atom
The `text-transform: capitalize` handling matched letters with hardcoded
Latin-only ranges, so Cyrillic, Greek and Armenian matched neither the
"titlecase this letter" class nor the "continues a word" class, and were
returned untransformed.
Build the patterns from the \p{L}, \p{M} and \p{N} Unicode property escapes
under the "u" flag instead. The enclosed alphanumerics range stays explicit:
those are symbols rather than letters, but do have case mappings. Engines
without the "u" flag fall back to the previous Latin-only literals, so the
IE driver's atom keeps its current behaviour.
Get Element Text is a driver-side endpoint, served from each browser's own
vendored copy of the atom, so the Python tests for non-Latin text stay
xfail until this is upstreamed into Chromium and Gecko.
Fixes #17945
* [py] xfail the Latin text-transform test on WebKit
WebKit computes Get Element Text without applying text-transform at all, so
Safari returns the untransformed source text even for Latin script. This is
unrelated to the non-Latin capitalize bug the rest of this change fixes -
Chrome, Edge and Firefox all pass the Latin assertions.
NOKEYCHECK=True
GitOrigin-RevId: 5d90b1dce34154446da111e0c510d4c7e13f18ca
1 file changed