зеркало из https://github.com/mozilla/pjs.git
Don't half-support document.write in XHTML. Bug 332848, r=mrbkap, jst, sr=dvediz, a=dvediz
This commit is contained in:
Родитель
7e992c0c64
Коммит
b08f319a19
|
@ -1904,13 +1904,14 @@ nsHTMLDocument::SetCookie(const nsAString& aCookie)
|
||||||
nsresult
|
nsresult
|
||||||
nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
|
nsHTMLDocument::OpenCommon(const nsACString& aContentType, PRBool aReplace)
|
||||||
{
|
{
|
||||||
|
if (IsXHTML()) {
|
||||||
|
// No calling document.open() on XHTML
|
||||||
|
|
||||||
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
// If we already have a parser we ignore the document.open call.
|
// If we already have a parser we ignore the document.open call.
|
||||||
if (mParser) {
|
if (mParser) {
|
||||||
if (IsXHTML()) {
|
|
||||||
// No calling document.open() while we're parsing XHTML
|
|
||||||
|
|
||||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -2179,6 +2180,12 @@ nsHTMLDocument::Clear()
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsHTMLDocument::Close()
|
nsHTMLDocument::Close()
|
||||||
{
|
{
|
||||||
|
if (IsXHTML()) {
|
||||||
|
// No calling document.close() on XHTML!
|
||||||
|
|
||||||
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
if (mParser && mWriteState == eDocumentOpened) {
|
if (mParser && mWriteState == eDocumentOpened) {
|
||||||
|
@ -2242,6 +2249,12 @@ nsresult
|
||||||
nsHTMLDocument::WriteCommon(const nsAString& aText,
|
nsHTMLDocument::WriteCommon(const nsAString& aText,
|
||||||
PRBool aNewlineTerminate)
|
PRBool aNewlineTerminate)
|
||||||
{
|
{
|
||||||
|
if (IsXHTML()) {
|
||||||
|
// No calling document.write*() on XHTML!
|
||||||
|
|
||||||
|
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
void *key = GenerateParserKey();
|
void *key = GenerateParserKey();
|
||||||
|
@ -2262,10 +2275,6 @@ nsHTMLDocument::WriteCommon(const nsAString& aText,
|
||||||
if (NS_FAILED(rv) || !mParser) {
|
if (NS_FAILED(rv) || !mParser) {
|
||||||
return rv;
|
return rv;
|
||||||
}
|
}
|
||||||
} else if (IsXHTML()) {
|
|
||||||
// No calling document.write*() while parsing XHTML!
|
|
||||||
|
|
||||||
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static NS_NAMED_LITERAL_STRING(new_line, "\n");
|
static NS_NAMED_LITERAL_STRING(new_line, "\n");
|
||||||
|
|
Загрузка…
Ссылка в новой задаче