Checking in patch by smaug@welho.com. Fixing bug 242151. Making document.body work right in XHTML documents when the body is a frameset element. Also fixing a compiler warning while I'm at it. r+sr=jst@mozilla.jstenback.com
git-svn-id: svn://10.0.0.236/trunk@155758 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1719,20 +1719,23 @@ nsHTMLDocument::GetBody(nsIDOMHTMLElement** aBody)
|
||||
|
||||
nsCOMPtr<nsIDOMNodeList> nodeList;
|
||||
|
||||
// XXX: This is not quite right, and we should deal with XHTML
|
||||
// here too.
|
||||
nsresult rv = GetElementsByTagName(NS_LITERAL_STRING("frameset"),
|
||||
getter_AddRefs(nodeList));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
nsresult rv;
|
||||
if (IsXHTML()) {
|
||||
rv = GetElementsByTagNameNS(NS_LITERAL_STRING(NS_HTML_NAMESPACE),
|
||||
NS_LITERAL_STRING("frameset"),
|
||||
getter_AddRefs(nodeList));
|
||||
} else {
|
||||
rv = GetElementsByTagName(NS_LITERAL_STRING("frameset"),
|
||||
getter_AddRefs(nodeList));
|
||||
}
|
||||
|
||||
if (nodeList) {
|
||||
rv = nodeList->Item(0, getter_AddRefs(node));
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
rv |= nodeList->Item(0, getter_AddRefs(node));
|
||||
|
||||
element = node;
|
||||
}
|
||||
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
return element ? CallQueryInterface(element, aBody) : NS_OK;
|
||||
@@ -2175,7 +2178,7 @@ nsHTMLDocument::Open(PRBool aReplace, nsIDOMDocument** aReturn)
|
||||
return CallQueryInterface(this, aReturn);
|
||||
}
|
||||
|
||||
#define NS_GENERATE_PARSER_KEY() (void*)((mIsWriting << 31) | (mWriteLevel & 0x7fffffff))
|
||||
#define NS_GENERATE_PARSER_KEY() NS_INT32_TO_PTR((mIsWriting << 31) | (mWriteLevel & 0x7fffffff))
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsHTMLDocument::Clear()
|
||||
|
||||
Reference in New Issue
Block a user