Bug 405181 - "nsIDOMNSRange.isPointInRange probably shouldn't throw WRONG_DOCUMENT_ERR" [p=ajvincent@gmail.com (Alex Vincent) r+sr+a1.9=sicking]

This commit is contained in:
reed@reedloden.com 2007-11-28 00:45:44 -08:00
parent 505b47d380
commit 9c2b6d8aa0

View File

@ -343,6 +343,12 @@ nsRange::IsPointInRange(nsIDOMNode* aParent, PRInt32 aOffset, PRBool* aResult)
{
PRInt16 compareResult = 0;
nsresult rv = ComparePoint(aParent, aOffset, &compareResult);
// If the node isn't in the range's document, it clearly isn't in the range.
if (rv == NS_ERROR_DOM_WRONG_DOCUMENT_ERR) {
*aResult = PR_FALSE;
return NS_OK;
}
*aResult = compareResult == 0;
return rv;