tor-browser

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

commit cecd272556e37418cd6b454fe81eee0bd7b2a138
parent 6a5aeaf8ca6377571a121c6ed38cd67e0d90b8f9
Author: minghuaw <michael.wu1107@gmail.com>
Date:   Tue, 21 Oct 2025 10:16:51 +0000

Bug 1994214 [wpt PR 55412] - script: Fix script string transfered to mozjs with wrong encoding, a=testonly

Automatic update from web-platform-tests
add wpt test cjk-string-assignment-to-paragraph

Signed-off-by: minghuaw <michael.wu1107@gmail.com>

--

wpt-commits: 6517ab14457b3828237177a3ae8d4c0882ee2727
wpt-pr: 55412

Diffstat:
Atesting/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph-ref.html | 12++++++++++++
Atesting/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph.html | 26++++++++++++++++++++++++++
2 files changed, 38 insertions(+), 0 deletions(-)

diff --git a/testing/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph-ref.html b/testing/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph-ref.html @@ -0,0 +1,12 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>CJK characters should remain the same in trusted script evaluation</title> +</head> +<body> + <p id="test-chinese">中文</p> + <p id="test-japanese">日本語</p> + <p id="test-korean">한국어</p> +</body> +</html> diff --git a/testing/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph.html b/testing/web-platform/tests/trusted-types/cjk-string-assignment-to-paragraph.html @@ -0,0 +1,26 @@ +<!DOCTYPE html> +<html lang="en"> +<head> + <meta charset="UTF-8"> + <title>CJK characters should remain the same in trusted script evaluation</title> + <link rel="match" href="cjk-string-assignment-to-paragraph-ref.html"> + <meta name="assert" content="CJK characters should remain the same in trusted script evaluation"> +</head> +<body> + <p id="test-chinese">Chinese</p> + <p id="test-japanese">Japanese</p> + <p id="test-korean">Korean</p> + + <script> + const policy = trustedTypes.createPolicy('test', { + createScript: script => script + }); + const trustedScript = policy.createScript(` + document.getElementById("test-chinese").textContent = "中文"; + document.getElementById("test-japanese").textContent = "日本語"; + document.getElementById("test-korean").textContent = "한국어" + `); + eval(trustedScript); + </script> +</body> +</html>