tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit d279a1a33369eba32098730d701043c1417f090c
parent 1dd24934d2144d52dc4fa0d5b9ff4c5cf0ecb85b
Author: Jonathan Kew <jkew@mozilla.com>
Date:   Sat,  6 Dec 2025 00:21:52 +0000

Bug 2003721 - Add some tests for case-insensitivity of language tag matching. r=layout-reviewers,emilio

Differential Revision: https://phabricator.services.mozilla.com/D275270

Diffstat:
Atesting/web-platform/tests/css/css-content/quotes-035.html | 32++++++++++++++++++++++++++++++++
Atesting/web-platform/tests/css/css-content/reference/quotes-035-ref.html | 28++++++++++++++++++++++++++++
Atesting/web-platform/tests/css/css-text-decor/text-emphasis-position-auto-002.html | 43+++++++++++++++++++++++++++++++++++++++++++
Atesting/web-platform/tests/css/css-text/hyphens/lang-tag-case-insensitive.html | 32++++++++++++++++++++++++++++++++
Atesting/web-platform/tests/css/css-text/text-transform/text-transform-tailoring-001a.html | 22++++++++++++++++++++++
5 files changed, 157 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/css/css-content/quotes-035.html b/testing/web-platform/tests/css/css-content/quotes-035.html @@ -0,0 +1,32 @@ +<!doctype html> +<html lang="en"> +<meta charset=utf-8> +<title>CSS Generated Content test: quotes</title> +<meta name="assert" content="lang tag matching is not case-sensitive, and ignores extra subtags"> +<link rel="help" href="https://drafts.csswg.org/css-content-3/#quotes"> +<link rel="help" href="https://www.rfc-editor.org/rfc/rfc4647.txt#:~:text=insensitive"> +<link rel=match href="reference/quotes-035-ref.html"> +<style> +body { font: 15px serif; } +p { margin: 3px 0; } +</style> +<body> +<p>Test passes if quote marks in each pair of lines match:</p> + +<p lang="fr"><q>fr</q></p> +<p lang="FR"><q>fr</q></p> +<br> +<p lang="en"><q>en</q></p> +<p lang="eN-Us"><q>en</q></p> +<br> +<p lang="fi"><q>fi</q></p> +<p lang="Fi"><q>fi</q></p> +<br> +<p lang="he"><q>he</q></p> +<p lang="he-IL"><q>he</q></p> +<br> +<p lang="de"><q>de</q></p> +<p lang="DE-LATN-DE"><q>de</q></p> +<br> +<p lang="ja"><q>ja</q></p> +<p lang="JA"><q>ja</q></p> diff --git a/testing/web-platform/tests/css/css-content/reference/quotes-035-ref.html b/testing/web-platform/tests/css/css-content/reference/quotes-035-ref.html @@ -0,0 +1,28 @@ +<!doctype html> +<html lang="en"> +<meta charset=utf-8> +<title>CSS Generated Content reference: quotes</title> +<style> +body { font: 15px serif; } +p { margin: 3px 0; } +</style> +<body> +<p>Test passes if quote marks in each pair of lines match:</p> + +<p lang="fr"><q>fr</q></p> +<p lang="fr"><q>fr</q></p> +<br> +<p lang="en"><q>en</q></p> +<p lang="en"><q>en</q></p> +<br> +<p lang="fi"><q>fi</q></p> +<p lang="fi"><q>fi</q></p> +<br> +<p lang="he"><q>he</q></p> +<p lang="he"><q>he</q></p> +<br> +<p lang="de"><q>de</q></p> +<p lang="de"><q>de</q></p> +<br> +<p lang="ja"><q>ja</q></p> +<p lang="ja"><q>ja</q></p> diff --git a/testing/web-platform/tests/css/css-text-decor/text-emphasis-position-auto-002.html b/testing/web-platform/tests/css/css-text-decor/text-emphasis-position-auto-002.html @@ -0,0 +1,43 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>text-emphasis-position auto value</title> +<link rel="help" href="https://drafts.csswg.org/css-text-decor/#propdef-text-emphasis-position"> +<link rel="match" href="text-emphasis-position-auto-001-ref.html"> +<style> +p { + border: solid silver; + text-emphasis: dot; + text-emphasis-position: auto; + margin: 0.5em; +} + +div { + float: left; + margin: 0.5em; +} +</style> + +<!-- lang tags should work even with non-canonical casing --> +<div lang="Zh"> + <p>你好 +</div> + +<div lang="jA"> + <p>今日は</p> +</div> + +<div lang="KO"> + <p>안녕하세요</p> +</div> + +<div lang="zH" style="writing-mode: vertical-rl"> + <p>你好 +</div> + +<div lang="JA" style="writing-mode: vertical-rl"> + <p>今日は</p> +</div> + +<div lang="Ko" style="writing-mode: vertical-rl"> + <p>안녕하세요</p> +</div> diff --git a/testing/web-platform/tests/css/css-text/hyphens/lang-tag-case-insensitive.html b/testing/web-platform/tests/css/css-text/hyphens/lang-tag-case-insensitive.html @@ -0,0 +1,32 @@ +<!doctype html> +<html lang="en" class="reftest-wait"> + <link rel="help" href="https://www.w3.org/TR/css-text-3/#hyphenation"> + <link rel="match" href="reference/hyphens-character-ref.html"> + <meta charset="utf-8" /> + <meta content="Checks that language tag works with mixed/non-canonical case" name="assert"> + <!-- copied from hyphens-character.html with just the lang tag modified --> + <style> + @font-face { + font-family: roboto_hyphen; + src: url(resources/roboto_hyphenation_subset.ttf) + } + + div { + display: block; + width: 40px; + hyphens: auto; + -webkit-hyphens: auto; + font-family: roboto_hyphen, cursive; + } + </style> + <body> + <div lang="De-dE"> + Donaudampfschifffahrt + </div> + + <script> + document.fonts.ready.then( + () => { document.documentElement.classList.remove("reftest-wait"); }); + </script> + </body> +</html> diff --git a/testing/web-platform/tests/css/css-text/text-transform/text-transform-tailoring-001a.html b/testing/web-platform/tests/css/css-text/text-transform/text-transform-tailoring-001a.html @@ -0,0 +1,21 @@ +<!DOCTYPE html> +<html lang="en"> +<head> +<meta charset="utf-8"/> +<title>CSS3 Text, text transform: capitalize, Dutch IJ, non-canonical lang tag</title> +<meta name="assert" content="[Exploratory] the brower tailors text-transform: capitalize to put both I and J in titlecase at the start of a word when the language is Dutch."> +<!-- copied from text-transform-tailoring-001.html with lang tag modified --> +<link rel='help' href='https://drafts.csswg.org/css-text-3/#text-transform'> +<link rel="match" href="reference/text-transform-tailoring-001-ref.html"> +<style type='text/css'> +.test, .ref { font-size: 36px; font-family: 'Gentium Plus', 'Noto Serif', 'Noto Sans', webfont, sans-serif; border: 1px solid orange; margin: 10px; width: 200px; padding: 5px; } +/* the CSS above is not part of the test */ +.test { text-transform: capitalize; } +</style> +</head> +<body> +<p class="instructions">Test passes if the orange boxes are identical.</p> +<div class="test" lang="NL">ijsland</div> +<div class="ref">IJsland</div> +</body> +</html> +\ No newline at end of file