Skip to content

Commit

Permalink
Bug 1909763 [wpt PR 47284] - Navigation API: always resolve URLs usin…
Browse files Browse the repository at this point in the history
…g UTF-8, a=testonly

Automatic update from web-platform-tests
Navigation API: always resolve URLs using UTF-8

Follows whatwg/html#9756.

Fixed: 40283021
Change-Id: Iac654e94044fb97c4618599fee8ecedcd0efdb4d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5722413
Auto-Submit: Domenic Denicola <[email protected]>
Reviewed-by: Nate Chapin <[email protected]>
Commit-Queue: Nate Chapin <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1332686}

--

wpt-commits: 2f1700a56d0fefd1e68ba043e5b58ce64e31e27d
wpt-pr: 47284
  • Loading branch information
domenic authored and moz-wptsync-bot committed Jul 26, 2024
1 parent 653f158 commit ddb5391
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<!doctype html>
<meta charset={{GET[encoding]}}> <!-- ends up as <meta charset> by default which is windows-1252 -->
<meta name=variant content="?encoding=windows-1252">
<meta name=variant content="?encoding=x-cp1251">
<meta name=variant content="?encoding=utf8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<iframe id="i" src="/common/blank.html"></iframe>
<!-- Test for https://github.com/whatwg/html/pull/9756 -->

<script>
async_test(t => {
window.onload = t.step_func(() => {
i.contentWindow.navigation.navigate("?\u00FF");

i.onload = t.step_func_done(() => {
const iframeURL = new URL(i.contentWindow.navigation.currentEntry.url);
assert_equals(iframeURL.pathname, "/common/blank.html", "pathname");
assert_equals(iframeURL.search, "?%C3%BF", "search");
});
});
}, "navigate() should resolve URLs assuming UTF-8, ignoring the document's encoding");
</script>

0 comments on commit ddb5391

Please sign in to comment.