mirror of
https://github.com/servo/servo.git
synced 2025-08-07 06:25:32 +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
|
@ -4539,11 +4539,11 @@ pub fn reflect_referrer_policy_attribute(element: &Element) -> DOMString {
|
|||
DOMString::new()
|
||||
}
|
||||
|
||||
pub(crate) fn referrer_policy_for_element(element: &Element) -> Option<ReferrerPolicy> {
|
||||
pub(crate) fn referrer_policy_for_element(element: &Element) -> ReferrerPolicy {
|
||||
element
|
||||
.get_attribute_by_name(DOMString::from_string(String::from("referrerpolicy")))
|
||||
.and_then(|attribute: DomRoot<Attr>| determine_policy_for_token(&attribute.Value()))
|
||||
.or_else(|| document_from_node(element).get_referrer_policy())
|
||||
.map(|attribute: DomRoot<Attr>| determine_policy_for_token(&attribute.Value()))
|
||||
.unwrap_or(document_from_node(element).get_referrer_policy())
|
||||
}
|
||||
|
||||
pub(crate) fn cors_setting_for_element(element: &Element) -> Option<CorsSettings> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue