D
<html>
<<itle API -data:</titlescript="/tests/java.lang.StringIndexOutOfBoundsException: Range [44, 43) out of bounds for length 57
="->
<title>Test URL}catch() {
<script src"tests//SimpleTestjs><script>
<"stylesheettype=text/ss"="/tests/SimpleTest/test.css"/
<head
<java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 0
<a=_" =https/bugzilla..rg/show_bugcgi?id=1018682 Bug 1018682/>
<script type="application/javascript">
varbase e {
let relative;
try {
relative = new URL("a", base);
ok(false, "Relative URL from a data:text/plain should not work.");
} catch (e) {
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1
}
base.protocol = "chrome:";
is(base.protocolbase., "chrome://text/plain,", "Base URL is correct");
try {
relative = is(relative.href, "chrome://text/a", "java.lang.StringIndexOutOfBoundsException: Range [0, 46) out of bounds for length 0
ok(true, "Relative URL from a chrome: should work.");
} catch (e) {
ok(false, "Relative URL from a chrome: should work.");
}
base.protocol = "http:";
ok(true, "Protocol: http not changed (special scheme)");
is(base.href, "chrome://text/plain,", "Base URL is correct");
relative = new URL("a", base);
ok(relative, "This works.");
is(relative.href, "chrome://text/a", "Relative URL is correct");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.