LibWeb: Pass locale to to_lowercase() from apply_text_transform

Previously we passed `{}` which resulted in incorrect text when using
some languages like `lt`.

Fixes:
http://wpt.fyi/results/css/css-text/text-transform/text-transform-upperlower-039.html
This commit is contained in:
Grubre 2024-10-29 12:05:52 +01:00 committed by Tim Flynn
parent 1b25fb5d40
commit 5a6a7b7e5e
Notes: github-actions[bot] 2024-11-01 11:49:25 +00:00
3 changed files with 29 additions and 1 deletions

View file

@ -0,0 +1 @@
i̇̀ i̇̀ i̇́ i̇́ i̇̃ i̇̃ i̇̀ i̇̀ j̇́ j̇́ į̇̃ į̇̃

View file

@ -0,0 +1,27 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8"/>
<style type='text/css'>
.test { text-transform: lowercase; }
</style>
</head>
<script src="../include.js"></script>
<body>
<div class="test" lang="lt">
<span>&#xCC; &#x69;&#x307;&#x300;</span> <span>&#xCD; &#x69;&#x307;&#x301;</span> <span>&#x128; &#x69;&#x307;&#x303;</span>
<span>&#x49;&#x300; &#x69;&#x307;&#x300;</span> <span>&#x4A;&#x301; &#x6A;&#x307;&#x301;</span> <span>&#x12E;&#x303; &#x12F;&#x307;&#x303;</span>
</div>
<script>
test(() => {
var elements = document.getElementsByClassName('test');
for (var i = 0; i < elements.length; i++) {
println(elements[i].innerText);
}
});
</script>
</body>
</html>

View file

@ -285,7 +285,7 @@ static ErrorOr<String> apply_text_transform(String const& string, CSS::TextTrans
case CSS::TextTransform::Uppercase:
return string.to_uppercase(locale);
case CSS::TextTransform::Lowercase:
return string.to_lowercase();
return string.to_lowercase(locale);
case CSS::TextTransform::None:
return string;
case CSS::TextTransform::MathAuto: