Skip to content

Commit

Permalink
Navigation API: always resolve URLs using UTF-8
Browse files Browse the repository at this point in the history
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}
  • Loading branch information
domenic authored and chromium-wpt-export-bot committed Jul 25, 2024
1 parent bc4ee2a commit fca628b
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions navigation-api/navigation-methods/navigate-relative-url-utf8.html
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 fca628b

Please sign in to comment.