Bug 1166910 - referrer attribute for img tag. r=hsivonen
This commit is contained in:
@@ -106,6 +106,8 @@
|
||||
#include "mozilla/dom/HTMLBodyElement.h"
|
||||
#include "imgIContainer.h"
|
||||
|
||||
#include "mozilla/net/ReferrerPolicy.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::dom;
|
||||
|
||||
@@ -995,6 +997,10 @@ nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID,
|
||||
return aResult.ParseIntValue(aValue);
|
||||
}
|
||||
|
||||
if (aAttribute == nsGkAtoms::referrer) {
|
||||
return ParseReferrerAttribute(aValue, aResult);
|
||||
}
|
||||
|
||||
if (aAttribute == nsGkAtoms::name) {
|
||||
// Store name as an atom. name="" means that the element has no name,
|
||||
// not that it has an emptystring as the name.
|
||||
@@ -1262,6 +1268,19 @@ nsGenericHTMLElement::ParseImageAttribute(nsIAtom* aAttribute,
|
||||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
nsGenericHTMLElement::ParseReferrerAttribute(const nsAString& aString,
|
||||
nsAttrValue& aResult)
|
||||
{
|
||||
static const nsAttrValue::EnumTable kReferrerTable[] = {
|
||||
{ "no-referrer", net::RP_No_Referrer },
|
||||
{ "origin", net::RP_Origin },
|
||||
{ "unsafe-url", net::RP_Unsafe_URL },
|
||||
{ 0 }
|
||||
};
|
||||
return aResult.ParseEnumValue(aString, kReferrerTable, false);
|
||||
}
|
||||
|
||||
bool
|
||||
nsGenericHTMLElement::ParseFrameborderValue(const nsAString& aString,
|
||||
nsAttrValue& aResult)
|
||||
|
||||
Reference in New Issue
Block a user