haikuwebkit/LayoutTests/fast/url/invalid-idn.html

38 lines
874 B
HTML
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-16">
<!-- Set the base so that the current URL does not affect the tests. -->
<base href="">
</head>
<body>
<script>
if (window.testRunner)
testRunner.dumpAsText();
// Start the bidding at 42 for no particular reason.
var lastID = 42;
function canonicalize(url)
{
var id = ++lastID;
document.write("<a id='" + id + "' href='" + url + "'></a>");
return document.getElementById(id).href;
}
// Those are all invalid URLs. They should not be accepted by the parser.
var testSet = [
'http://.com',
'http://www.اast.fm'
];
document.write("Test passes if all the invalid urls are converted to about:blank.<br>");
for (var i = 0; i < testSet.length; ++i) {
src = canonicalize(testSet[i]);
document.write(src + "<br>");
}
</script>
</body>
</html>