зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1175736 - Implement the iframe referrer attribute. r=ckerschb, r=bz
This commit is contained in:
Родитель
25bee46b21
Коммит
cafd09a21a
|
@ -378,7 +378,19 @@ nsFrameLoader::ReallyStartLoadingInternal()
|
|||
}
|
||||
}
|
||||
|
||||
loadInfo->SetReferrerPolicy(mOwnerContent->OwnerDoc()->GetReferrerPolicy());
|
||||
// get referrer policy for this iframe:
|
||||
// first load document wide policy, then
|
||||
// load iframe referrer attribute if enabled in preferences
|
||||
// per element referrer overrules document wide referrer if enabled
|
||||
net::ReferrerPolicy referrerPolicy = mOwnerContent->OwnerDoc()->GetReferrerPolicy();
|
||||
HTMLIFrameElement* iframe = HTMLIFrameElement::FromContent(mOwnerContent);
|
||||
if (iframe) {
|
||||
net::ReferrerPolicy iframeReferrerPolicy = iframe->GetReferrerPolicy();
|
||||
if (iframeReferrerPolicy != net::RP_Unset) {
|
||||
referrerPolicy = iframeReferrerPolicy;
|
||||
}
|
||||
}
|
||||
loadInfo->SetReferrerPolicy(referrerPolicy);
|
||||
|
||||
// Default flags:
|
||||
int32_t flags = nsIWebNavigation::LOAD_FLAGS_NONE;
|
||||
|
|
|
@ -159,6 +159,15 @@ public:
|
|||
{
|
||||
SetHTMLAttr(nsGkAtoms::marginheight, aMarginHeight, aError);
|
||||
}
|
||||
void SetReferrer(const nsAString& aReferrer, ErrorResult& aError)
|
||||
{
|
||||
SetHTMLAttr(nsGkAtoms::referrer, aReferrer, aError);
|
||||
}
|
||||
void GetReferrer(nsAString& aReferrer)
|
||||
{
|
||||
GetHTMLAttr(nsGkAtoms::referrer, aReferrer);
|
||||
}
|
||||
|
||||
nsIDocument* GetSVGDocument()
|
||||
{
|
||||
return GetContentDocument();
|
||||
|
|
|
@ -26,6 +26,8 @@ interface HTMLIFrameElement : HTMLElement {
|
|||
attribute DOMString width;
|
||||
[SetterThrows, Pure]
|
||||
attribute DOMString height;
|
||||
[SetterThrows, Pure, Pref="network.http.enablePerElementReferrer"]
|
||||
attribute DOMString referrer;
|
||||
readonly attribute Document? contentDocument;
|
||||
readonly attribute WindowProxy? contentWindow;
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче