Bug 1187357 - rename referrer attribute to referrerpolicy. r=hsivonen

This commit is contained in:
Franziskus Kiefer 2015-11-30 16:13:03 -08:00
parent f83443eb1d
commit 2050e99124
15 changed files with 29 additions and 28 deletions

View File

@ -13486,7 +13486,7 @@ nsDocShell::OnLinkClickSync(nsIContent* aContent,
// if per element referrer is enabled, the element referrer overrules
// the document wide referrer
if (IsElementAnchor(aContent)) {
net::ReferrerPolicy refPolEnum = aContent->AsElement()->GetReferrerPolicy();
net::ReferrerPolicy refPolEnum = aContent->AsElement()->GetReferrerPolicyAsEnum();
if (refPolEnum != net::RP_Unset) {
refererPolicy = refPolEnum;
}

View File

@ -3606,11 +3606,11 @@ Element::FontSizeInflation()
}
net::ReferrerPolicy
Element::GetReferrerPolicy()
Element::GetReferrerPolicyAsEnum()
{
if (Preferences::GetBool("network.http.enablePerElementReferrer", false) &&
IsHTMLElement()) {
const nsAttrValue* referrerValue = GetParsedAttr(nsGkAtoms::referrer);
const nsAttrValue* referrerValue = GetParsedAttr(nsGkAtoms::referrerpolicy);
if (referrerValue && referrerValue->Type() == nsAttrValue::eEnum) {
return net::ReferrerPolicy(referrerValue->GetEnumValue());
}

View File

@ -1074,7 +1074,7 @@ public:
*/
float FontSizeInflation();
net::ReferrerPolicy GetReferrerPolicy();
net::ReferrerPolicy GetReferrerPolicyAsEnum();
protected:
/*

View File

@ -411,7 +411,7 @@ nsFrameLoader::ReallyStartLoadingInternal()
net::ReferrerPolicy referrerPolicy = mOwnerContent->OwnerDoc()->GetReferrerPolicy();
HTMLIFrameElement* iframe = HTMLIFrameElement::FromContent(mOwnerContent);
if (iframe) {
net::ReferrerPolicy iframeReferrerPolicy = iframe->GetReferrerPolicy();
net::ReferrerPolicy iframeReferrerPolicy = iframe->GetReferrerPolicyAsEnum();
if (iframeReferrerPolicy != net::RP_Unset) {
referrerPolicy = iframeReferrerPolicy;
}

View File

@ -594,6 +594,7 @@ GK_ATOM(menuseparator, "menuseparator")
GK_ATOM(message, "message")
GK_ATOM(meta, "meta")
GK_ATOM(referrer, "referrer")
GK_ATOM(referrerpolicy, "referrerpolicy")
GK_ATOM(meter, "meter")
GK_ATOM(method, "method")
GK_ATOM(microdataProperties, "microdataProperties")

View File

@ -121,13 +121,13 @@ public:
{
SetHTMLAttr(nsGkAtoms::rel, aValue, rv);
}
void SetReferrer(const nsAString& aValue, mozilla::ErrorResult& rv)
void SetReferrerPolicy(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetHTMLAttr(nsGkAtoms::referrer, aValue, rv);
SetHTMLAttr(nsGkAtoms::referrerpolicy, aValue, rv);
}
void GetReferrer(nsAString& aReferrer)
void GetReferrerPolicy(nsAString& aReferrer)
{
GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
GetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer);
}
nsDOMTokenList* RelList();
void GetHreflang(DOMString& aValue)

View File

@ -125,13 +125,13 @@ public:
}
nsDOMTokenList* RelList();
void SetReferrer(const nsAString& aValue, mozilla::ErrorResult& rv)
void SetReferrerPolicy(const nsAString& aValue, mozilla::ErrorResult& rv)
{
SetHTMLAttr(nsGkAtoms::referrer, aValue, rv);
SetHTMLAttr(nsGkAtoms::referrerpolicy, aValue, rv);
}
void GetReferrer(nsAString& aReferrer)
void GetReferrerPolicy(nsAString& aReferrer)
{
GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
GetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer);
}
// The Link::GetOrigin is OK for us

View File

@ -159,13 +159,13 @@ public:
{
SetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight, aError);
}
void SetReferrer(const nsAString& aReferrer, ErrorResult& aError)
void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::referrer, aReferrer, aError);
SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
}
void GetReferrer(nsAString& aReferrer)
void GetReferrerPolicy(nsAString& aReferrer)
{
GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
GetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer);
}
nsIDocument* GetSVGDocument()

View File

@ -189,19 +189,19 @@ public:
{
SetHTMLAttr(nsGkAtoms::border, aBorder, aError);
}
void SetReferrer(const nsAString& aReferrer, ErrorResult& aError)
void SetReferrerPolicy(const nsAString& aReferrer, ErrorResult& aError)
{
SetHTMLAttr(nsGkAtoms::referrer, aReferrer, aError);
SetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer, aError);
}
void GetReferrer(nsAString& aReferrer)
void GetReferrerPolicy(nsAString& aReferrer)
{
GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
GetHTMLAttr(nsGkAtoms::referrerpolicy, aReferrer);
}
net::ReferrerPolicy
GetImageReferrerPolicy() override
{
return GetReferrerPolicy();
return GetReferrerPolicyAsEnum();
}
int32_t X();

View File

@ -1003,7 +1003,7 @@ nsGenericHTMLElement::ParseAttribute(int32_t aNamespaceID,
return aResult.ParseIntValue(aValue);
}
if (aAttribute == nsGkAtoms::referrer) {
if (aAttribute == nsGkAtoms::referrerpolicy) {
return ParseReferrerAttribute(aValue, aResult);
}

View File

@ -22,7 +22,7 @@ interface HTMLAnchorElement : HTMLElement {
[SetterThrows]
attribute DOMString rel;
[SetterThrows, Pref="network.http.enablePerElementReferrer"]
attribute DOMString referrer;
attribute DOMString referrerPolicy;
readonly attribute DOMTokenList relList;
[SetterThrows]
attribute DOMString hreflang;

View File

@ -29,7 +29,7 @@ interface HTMLAreaElement : HTMLElement {
[SetterThrows]
attribute DOMString rel;
[SetterThrows, Pref="network.http.enablePerElementReferrer"]
attribute DOMString referrer;
attribute DOMString referrerPolicy;
readonly attribute DOMTokenList relList;
};

View File

@ -27,7 +27,7 @@ interface HTMLIFrameElement : HTMLElement {
[SetterThrows, Pure]
attribute DOMString height;
[SetterThrows, Pure, Pref="network.http.enablePerElementReferrer"]
attribute DOMString referrer;
attribute DOMString referrerPolicy;
readonly attribute Document? contentDocument;
readonly attribute WindowProxy? contentWindow;
};

View File

@ -30,7 +30,7 @@ interface HTMLImageElement : HTMLElement {
[SetterThrows]
attribute DOMString useMap;
[SetterThrows, Pref="network.http.enablePerElementReferrer"]
attribute DOMString referrer;
attribute DOMString referrerPolicy;
[SetterThrows]
attribute boolean isMap;
[SetterThrows]

View File

@ -128,7 +128,7 @@ nsHtml5TreeBuilder::createElement(int32_t aNamespace, nsIAtom* aName,
nsString* crossOrigin =
aAttributes->getValue(nsHtml5AttributeName::ATTR_CROSSORIGIN);
nsString* referrerPolicy =
aAttributes->getValue(nsHtml5AttributeName::ATTR_REFERRER);
aAttributes->getValue(nsHtml5AttributeName::ATTR_REFERRERPOLICY);
nsString* sizes =
aAttributes->getValue(nsHtml5AttributeName::ATTR_SIZES);
mSpeculativeLoadQueue.AppendElement()->