mDocument->GetBaseURL(getter_AddRefs(mDocumentBaseURL));
mDocumentBaseURL = mDocument->GetBaseURL();
HTMLContentSink::ProcessBaseHref(const nsAString& aBaseHref){  //-- Make sure this page is allowed to load this URL  nsresult rv;  nsCOMPtr<nsIURI> baseHrefURI;  rv = NS_NewURI(getter_AddRefs(baseHrefURI), aBaseHref, nsnull);  if (NS_FAILED(rv)) return;  // Setting "BASE URL" from the last BASE tag appearing in HEAD.  if (!mBody) {    // The document checks if it is legal to set this base    rv = mDocument->SetBaseURL(baseHrefURI);    if (NS_SUCCEEDED(rv)) {      mDocument->GetBaseURL(getter_AddRefs(mDocumentBaseURL));    }  } else {    // NAV compatibility quirk    nsCOMPtr<nsIScriptSecurityManager> securityManager =      do_GetService(NS_SCRIPTSECURITYMANAGER_CONTRACTID, &rv);    if (NS_FAILED(rv)) {      return;    }    rv = securityManager->CheckLoadURI(mDocumentBaseURL, baseHrefURI,                                       nsIScriptSecurityManager::STANDARD);    if (NS_FAILED(rv)) {      return;    }    mBaseHREF = aBaseHref;  }}