5 <title>Test URL API - data:plain
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
10 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=1018682">Mozilla Bug
1018682</a>
12 <script type=
"application/javascript">
14 var base = new URL(
"data:text/plain,");
18 relative = new URL(
"a", base);
19 ok(false,
"Relative URL from a data:text/plain should not work.");
21 ok(true,
"Relative URL from a data:text/plain should not work.");
24 base.protocol =
"chrome:";
25 is(base.protocol,
"chrome:",
"The protocol should be changed from data to chrome.");
28 relative = new URL(
"a", base);
29 ok(true,
"Relative URL from a chrome: should work.");
31 ok(false,
"Relative URL from a chrome: should work.");
34 base.protocol =
"http:";
35 ok(true,
"Protocol: http not changed (special scheme)");
36 is(base.href,
"chrome://text/plain,",
"Base URL is correct");
38 relative = new URL(
"a", base);
39 ok(relative,
"This works.");
40 is(relative.href,
"chrome://text/a",
"Relative URL is correct");