diff --git a/content/html/document/src/nsHTMLDocument.cpp b/content/html/document/src/nsHTMLDocument.cpp
index 4b0003ab0f8..1d33e9e3fbb 100644
--- a/content/html/document/src/nsHTMLDocument.cpp
+++ b/content/html/document/src/nsHTMLDocument.cpp
@@ -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;
diff --git a/content/html/document/test/test_bug332848.xhtml b/content/html/document/test/test_bug332848.xhtml
index 1087455867f..f8f824d60cf 100644
--- a/content/html/document/test/test_bug332848.xhtml
+++ b/content/html/document/test/test_bug332848.xhtml
@@ -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");
}
}