mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-08 09:09:43 +00:00
LibWeb: Pass locale to to_uppercase()
from apply_text_transform
Previously we passed the default argument which is `{}`. This resulted in incorrect uppercasing for some languages like `tr`. Fixes: http://wpt.live/css/css-text/text-transform/text-transform-tailoring-002.html
This commit is contained in:
parent
47597d0fb8
commit
1b25fb5d40
Notes:
github-actions[bot]
2024-11-01 11:49:31 +00:00
Author: https://github.com/Grubre
Commit: 1b25fb5d40
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2045
Reviewed-by: https://github.com/trflynn89
4 changed files with 32 additions and 4 deletions
|
@ -0,0 +1,2 @@
|
||||||
|
ΚΑΛΗΜΕΡΑ ΑΥΡΙΟ
|
||||||
|
ΚΑΛΗΜΕΡΑ ΑΥΡΙΟ
|
|
@ -6,8 +6,8 @@ Rerun
|
||||||
|
|
||||||
Found 271 tests
|
Found 271 tests
|
||||||
|
|
||||||
209 Pass
|
210 Pass
|
||||||
62 Fail
|
61 Fail
|
||||||
Details
|
Details
|
||||||
Result Test Name MessagePass Simplest possible test ("<div>abc")
|
Result Test Name MessagePass Simplest possible test ("<div>abc")
|
||||||
Fail Leading whitespace removed ("<div> abc")
|
Fail Leading whitespace removed ("<div> abc")
|
||||||
|
@ -251,7 +251,7 @@ Pass unopened <details> ignored ("<div><details><summary>abc</summary>123")
|
||||||
Pass opened <details> content shown ("<div><details open><summary>abc</summary>123")
|
Pass opened <details> content shown ("<div><details open><summary>abc</summary>123")
|
||||||
Pass text-transform is applied ("<div><div style='text-transform:uppercase'>abc")
|
Pass text-transform is applied ("<div><div style='text-transform:uppercase'>abc")
|
||||||
Pass text-transform handles es-zet ("<div><div style='text-transform:uppercase'>Maß")
|
Pass text-transform handles es-zet ("<div><div style='text-transform:uppercase'>Maß")
|
||||||
Fail text-transform handles Turkish casing ("<div><div lang='tr' style='text-transform:uppercase'>i ı")
|
Pass text-transform handles Turkish casing ("<div><div lang='tr' style='text-transform:uppercase'>i ı")
|
||||||
Pass block-in-inline doesn't add unnecessary newlines ("<div>abc<span>123<div>456</div>789</span>def")
|
Pass block-in-inline doesn't add unnecessary newlines ("<div>abc<span>123<div>456</div>789</span>def")
|
||||||
Pass floats induce a block boundary ("<div>abc<div style='float:left'>123</div>def")
|
Pass floats induce a block boundary ("<div>abc<div style='float:left'>123</div>def")
|
||||||
Pass floats induce a block boundary ("<div>abc<span style='float:left'>123</span>def")
|
Pass floats induce a block boundary ("<div>abc<span style='float:left'>123</span>def")
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<style type='text/css'>
|
||||||
|
.test { text-transform: uppercase; }
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<script src="../include.js"></script>
|
||||||
|
<body>
|
||||||
|
<div class="test" lang="el">καλημέρα αύριο</div>
|
||||||
|
<div class="test">ΚΑΛΗΜΕΡΑ ΑΥΡΙΟ</div>
|
||||||
|
<div>IJsland</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
test(() => {
|
||||||
|
var elements = document.getElementsByClassName('test');
|
||||||
|
for (var i = 0; i < elements.length; i++) {
|
||||||
|
println(elements[i].innerText);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
|
@ -283,7 +283,7 @@ static ErrorOr<String> apply_text_transform(String const& string, CSS::TextTrans
|
||||||
{
|
{
|
||||||
switch (text_transform) {
|
switch (text_transform) {
|
||||||
case CSS::TextTransform::Uppercase:
|
case CSS::TextTransform::Uppercase:
|
||||||
return string.to_uppercase();
|
return string.to_uppercase(locale);
|
||||||
case CSS::TextTransform::Lowercase:
|
case CSS::TextTransform::Lowercase:
|
||||||
return string.to_lowercase();
|
return string.to_lowercase();
|
||||||
case CSS::TextTransform::None:
|
case CSS::TextTransform::None:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue