mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Implement referrerPolicy for HTMLLinkElement and HTMLScriptElement
This commit is contained in:
parent
02af8952eb
commit
a999850b24
15 changed files with 50 additions and 668 deletions
|
@ -13,7 +13,8 @@ use crate::dom::cssstylesheet::CSSStyleSheet;
|
|||
use crate::dom::document::Document;
|
||||
use crate::dom::domtokenlist::DOMTokenList;
|
||||
use crate::dom::element::{
|
||||
cors_setting_for_element, reflect_cross_origin_attribute, set_cross_origin_attribute,
|
||||
cors_setting_for_element, reflect_cross_origin_attribute, reflect_referrer_policy_attribute,
|
||||
set_cross_origin_attribute,
|
||||
};
|
||||
use crate::dom::element::{AttributeMutation, Element, ElementCreator};
|
||||
use crate::dom::htmlelement::HTMLElement;
|
||||
|
@ -490,6 +491,14 @@ impl HTMLLinkElementMethods for HTMLLinkElement {
|
|||
set_cross_origin_attribute(self.upcast::<Element>(), value);
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-link-referrerpolicy
|
||||
fn ReferrerPolicy(&self) -> DOMString {
|
||||
reflect_referrer_policy_attribute(self.upcast::<Element>())
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-link-referrerpolicy
|
||||
make_setter!(SetReferrerPolicy, "referrerpolicy");
|
||||
|
||||
// https://drafts.csswg.org/cssom/#dom-linkstyle-sheet
|
||||
fn GetSheet(&self) -> Option<DomRoot<DOMStyleSheet>> {
|
||||
self.get_cssom_stylesheet().map(DomRoot::upcast)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue