aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmliframeelement.rs
diff options
context:
space:
mode:
authorVincent Ricard <magic@magicninja.org>2020-09-20 23:05:41 +0200
committerVincent Ricard <magic@magicninja.org>2020-10-05 09:26:36 +0200
commit2a4dd894deb33bfe7c0d788afc9cc8c40c55ef48 (patch)
tree2e49fe758d0333ec09806e0d86f5ca900dfd2088 /components/script/dom/htmliframeelement.rs
parent3f7697690aabd2d8c31bc880fcae21250244219a (diff)
downloadservo-2a4dd894deb33bfe7c0d788afc9cc8c40c55ef48.tar.gz
servo-2a4dd894deb33bfe7c0d788afc9cc8c40c55ef48.zip
Implement DOMTokenList.supports API
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r--components/script/dom/htmliframeelement.rs17
1 files changed, 15 insertions, 2 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs
index 60c3e93ece8..345e815ee50 100644
--- a/components/script/dom/htmliframeelement.rs
+++ b/components/script/dom/htmliframeelement.rs
@@ -38,6 +38,7 @@ use script_traits::{
LoadOrigin, UpdatePipelineIdReason, WindowSizeData,
};
use script_traits::{NewLayoutInfo, ScriptMsg};
+use servo_atoms::Atom;
use servo_url::ServoUrl;
use std::cell::Cell;
use style::attr::{AttrValue, LengthOrPercentageOrAuto};
@@ -530,8 +531,20 @@ impl HTMLIFrameElementMethods for HTMLIFrameElement {
// https://html.spec.whatwg.org/multipage/#dom-iframe-sandbox
fn Sandbox(&self) -> DomRoot<DOMTokenList> {
- self.sandbox
- .or_init(|| DOMTokenList::new(self.upcast::<Element>(), &local_name!("sandbox")))
+ self.sandbox.or_init(|| {
+ DOMTokenList::new(
+ self.upcast::<Element>(),
+ &local_name!("sandbox"),
+ Some(vec![
+ Atom::from("allow-same-origin"),
+ Atom::from("allow-forms"),
+ Atom::from("allow-pointer-lock"),
+ Atom::from("allow-popups"),
+ Atom::from("allow-scripts"),
+ Atom::from("allow-top-navigation"),
+ ]),
+ )
+ })
}
// https://html.spec.whatwg.org/multipage/#dom-iframe-contentwindow