mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Remove referrer policy from document (#34263)
* Remove the referrer policy from document and rely on its policy container Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Make ReferrerPolicy non-optional, instead using a new enum value to represent the empty string case Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix clippy issue Signed-off-by: Shane Handley <shanehandley@fastmail.com> * Fix usage of Option<ReferrerPolicy> in unit test Signed-off-by: Shane Handley <shanehandley@fastmail.com> --------- Signed-off-by: Shane Handley <shanehandley@fastmail.com>
This commit is contained in:
parent
83f8e88818
commit
975e2ae859
108 changed files with 171 additions and 1509 deletions
|
@ -2426,7 +2426,7 @@ impl GlobalScope {
|
|||
}
|
||||
|
||||
/// Get the Referrer Policy for this global scope.
|
||||
pub fn get_referrer_policy(&self) -> Option<ReferrerPolicy> {
|
||||
pub fn get_referrer_policy(&self) -> ReferrerPolicy {
|
||||
if let Some(window) = self.downcast::<Window>() {
|
||||
let document = window.Document();
|
||||
|
||||
|
@ -2435,7 +2435,7 @@ impl GlobalScope {
|
|||
if let Some(worker) = self.downcast::<WorkerGlobalScope>() {
|
||||
let policy_container = worker.policy_container().to_owned();
|
||||
|
||||
return Some(policy_container.referrer_policy);
|
||||
return policy_container.get_referrer_policy();
|
||||
}
|
||||
unreachable!();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue