mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01: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
|
@ -76,7 +76,7 @@ struct PrefetchSink {
|
|||
#[no_trace]
|
||||
referrer: Referrer,
|
||||
#[no_trace]
|
||||
referrer_policy: Option<ReferrerPolicy>,
|
||||
referrer_policy: ReferrerPolicy,
|
||||
#[no_trace]
|
||||
resource_threads: ResourceThreads,
|
||||
prefetching: Cell<bool>,
|
||||
|
@ -203,10 +203,10 @@ impl PrefetchSink {
|
|||
ServoUrl::parse_with_base(Some(base), &attr.value).ok()
|
||||
}
|
||||
|
||||
fn get_referrer_policy(&self, tag: &Tag, name: LocalName) -> Option<ReferrerPolicy> {
|
||||
fn get_referrer_policy(&self, tag: &Tag, name: LocalName) -> ReferrerPolicy {
|
||||
self.get_attr(tag, name)
|
||||
.and_then(|attr| determine_policy_for_token(&attr.value))
|
||||
.or(self.referrer_policy)
|
||||
.map(|attr| determine_policy_for_token(&attr.value))
|
||||
.unwrap_or(self.referrer_policy)
|
||||
}
|
||||
|
||||
fn get_cors_settings(&self, tag: &Tag, name: LocalName) -> Option<CorsSettings> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue