wpt / navigation-api / navigation-methods / navigate-relative-url-utf8.html?encoding=windows-1252

Open test on wpt.live | wpt.fyi

Runs: Chrome 160.0.8195.0 (wpt@1ab8957e4, 2026-12-01) | Firefox 163.0a1 (wpt@1ab8957e4, 2026-12-01) | Safari 257 preview (wpt@1ab8957e4, 2026-12-01) | Ladybird 1.0-6ebf3 (wpt@a812f468c, 2026-12-02) | Servo Servo 0.8 (wpt@75c11f957, 2026-12-01) | Blitz 713a982dc (wpt@705f393a6, 2026-12-01)

ChromeFirefoxSafariLadybirdServoBlitz
Total1/11/11/11/10/1NOT RUN
SubtestChromeFirefoxSafariLadybirdServoBlitz
navigate() should resolve URLs assuming UTF-8, ignoring the document's encodingPASSPASSPASSPASSFAIL—

/navigation-api/navigation-methods/navigate-relative-url-utf8.html

<!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>