Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /navigation-api/navigation-methods/navigate-relative-url-utf8.html?encoding=utf8 - WPT Dashboard Interop Dashboard
- /navigation-api/navigation-methods/navigate-relative-url-utf8.html?encoding=windows-1252 - WPT Dashboard Interop Dashboard
- /navigation-api/navigation-methods/navigate-relative-url-utf8.html?encoding=x-cp1251 - WPT Dashboard Interop Dashboard
<!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>
<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>