Bug 1266077. Fix <base> href getter to follow the spec; it should be using the fallback base URI to resolve against, not the document URI. r=bkelly
This commit is contained in:
@@ -61,13 +61,15 @@ NS_IMPL_STRING_ATTR(HTMLSharedElement, Target, target)
|
||||
NS_IMETHODIMP
|
||||
HTMLSharedElement::GetHref(nsAString& aValue)
|
||||
{
|
||||
MOZ_ASSERT(mNodeInfo->Equals(nsGkAtoms::base),
|
||||
"This should only get called for <base> elements");
|
||||
nsAutoString href;
|
||||
GetAttr(kNameSpaceID_None, nsGkAtoms::href, href);
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
nsIDocument* doc = OwnerDoc();
|
||||
nsContentUtils::NewURIWithDocumentCharset(
|
||||
getter_AddRefs(uri), href, doc, doc->GetDocumentURI());
|
||||
getter_AddRefs(uri), href, doc, doc->GetFallbackBaseURI());
|
||||
|
||||
if (!uri) {
|
||||
aValue = href;
|
||||
|
||||
Reference in New Issue
Block a user