Bug 554707. Throw the right exception when document.open/close/write/writeln happen on an XHTML document. r=bzbarsky

This commit is contained in:
Ms2ger
2010-04-01 22:09:05 -04:00
parent 191e11bca4
commit eef705f827
2 changed files with 14 additions and 6 deletions

View File

@@ -28,7 +28,7 @@ function test() {
document.open();
is(0, 1, "document.open succeeded");
} catch (e) {
is (e.code, DOMException.INVALID_ACCESS_ERR,
is (e.code, DOMException.INVALID_STATE_ERR,
"Wrong exception from document.open");
}
@@ -36,7 +36,15 @@ function test() {
document.write("aaa");
is(0, 1, "document.write succeeded");
} catch (e) {
is (e.code, DOMException.INVALID_ACCESS_ERR,
is (e.code, DOMException.INVALID_STATE_ERR,
"Wrong exception from document.write");
}
try {
document.writeln("aaa");
is(0, 1, "document.write succeeded");
} catch (e) {
is (e.code, DOMException.INVALID_STATE_ERR,
"Wrong exception from document.write");
}
@@ -44,7 +52,7 @@ function test() {
document.close();
is(0, 1, "document.close succeeded");
} catch (e) {
is (e.code, DOMException.INVALID_ACCESS_ERR,
is (e.code, DOMException.INVALID_STATE_ERR,
"Wrong exception from document.close");
}
}