forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Navigation: always resolve URLs with UTF-8
https://bugs.webkit.org/show_bug.cgi?id=276809 Reviewed by NOBODY (OOPS!). Implement the spec change from whatwg/html#9756. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-relative-url-utf8.html: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-relative-url-utf8_encoding=utf8-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-relative-url-utf8_encoding=windows-1252-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/navigation-api/navigation-methods/navigate-relative-url-utf8_encoding=x-cp1251-expected.txt: Added. * Source/WebCore/page/Navigation.cpp: (WebCore::Navigation::navigate):
- Loading branch information
Showing
5 changed files
with
36 additions
and
1 deletion.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
.../w3c/web-platform-tests/navigation-api/navigation-methods/navigate-relative-url-utf8.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
4 changes: 4 additions & 0 deletions
4
...s/navigation-api/navigation-methods/navigate-relative-url-utf8_encoding=utf8-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
|
||
PASS navigate() should resolve URLs assuming UTF-8, ignoring the document's encoding | ||
|
4 changes: 4 additions & 0 deletions
4
...tion-api/navigation-methods/navigate-relative-url-utf8_encoding=windows-1252-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
|
||
PASS navigate() should resolve URLs assuming UTF-8, ignoring the document's encoding | ||
|
4 changes: 4 additions & 0 deletions
4
...vigation-api/navigation-methods/navigate-relative-url-utf8_encoding=x-cp1251-expected.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
|
||
PASS navigate() should resolve URLs assuming UTF-8, ignoring the document's encoding | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters