зеркало из https://github.com/mozilla/pjs.git
Bug 516359 - document.(open|write|writeln|close) in XHTML throws the wrong error. r=smaug
This commit is contained in:
Родитель
f769fad055
Коммит
35eeea7629
|
@ -1796,7 +1796,7 @@ nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
|
|||
if (!IsHTML()) {
|
||||
// No calling document.open() on XHTML
|
||||
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
|
||||
}
|
||||
|
||||
PRBool loadAsHtml5 = nsHtml5Module::sEnabled;
|
||||
|
@ -2056,7 +2056,7 @@ nsHTMLDocument::Close()
|
|||
if (!IsHTML()) {
|
||||
// No calling document.close() on XHTML!
|
||||
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
@ -2121,7 +2121,7 @@ nsHTMLDocument::WriteCommon(const nsAString& aText,
|
|||
if (!IsHTML()) {
|
||||
// No calling document.write*() on XHTML!
|
||||
|
||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||
return NS_ERROR_DOM_INVALID_ACCESS_ERR;
|
||||
}
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
|
|
|
@ -28,7 +28,7 @@ function test() {
|
|||
document.open();
|
||||
is(0, 1, "document.open succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
is (e.code, DOMException.INVALID_ACCESS_ERR,
|
||||
"Wrong exception from document.open");
|
||||
}
|
||||
|
||||
|
@ -36,7 +36,7 @@ function test() {
|
|||
document.write("aaa");
|
||||
is(0, 1, "document.write succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
is (e.code, DOMException.INVALID_ACCESS_ERR,
|
||||
"Wrong exception from document.write");
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ function test() {
|
|||
document.close();
|
||||
is(0, 1, "document.close succeeded");
|
||||
} catch (e) {
|
||||
is (e.code, DOMException.NOT_SUPPORTED_ERR,
|
||||
is (e.code, DOMException.INVALID_ACCESS_ERR,
|
||||
"Wrong exception from document.close");
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче