#469, #399: more adblock hosts, faster StringBegins/End, any-link, base/srcdoc M1247359 M843579 M1238804

This commit is contained in:
Cameron Kaiser
2018-03-18 20:23:52 -07:00
parent 8f266f3359
commit 41675e9698
7 changed files with 85 additions and 18 deletions
+3 -2
View File
@@ -164,14 +164,15 @@ SetBaseURIUsingFirstBaseWithHref(nsIDocument* aDocument, nsIContent* aMustMatch)
return;
}
// Resolve the <base> element's href relative to our document URI
// Resolve the <base> element's href relative to our document's
// fallback base URI.
nsAutoString href;
child->GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
nsCOMPtr<nsIURI> newBaseURI;
nsContentUtils::NewURIWithDocumentCharset(
getter_AddRefs(newBaseURI), href, aDocument,
aDocument->GetDocumentURI());
aDocument->GetFallbackBaseURI());
// Try to set our base URI. If that fails, try to set base URI to null
nsresult rv = aDocument->SetBaseURI(newBaseURI);