Bug 554707. Throw the right exception when document.open/close/write/writeln happen on an XHTML document. r=bzbarsky
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user