diff options
author | Bastien Orivel <eijebong@bananium.fr> | 2017-10-30 12:15:30 +0100 |
---|---|---|
committer | Bastien Orivel <eijebong@bananium.fr> | 2017-10-30 23:36:06 +0100 |
commit | 29b4eec14187c96a1518af6a954bd00194375382 (patch) | |
tree | c49cf779948919fb4a21c93986395ae1fd149b0b /components/script/dom/htmliframeelement.rs | |
parent | b6475cf433747a8b0cd177f0a16abae9d795e41c (diff) | |
download | servo-29b4eec14187c96a1518af6a954bd00194375382.tar.gz servo-29b4eec14187c96a1518af6a954bd00194375382.zip |
Bump bitflags to 1.0 in every servo crate
Diffstat (limited to 'components/script/dom/htmliframeelement.rs')
-rw-r--r-- | components/script/dom/htmliframeelement.rs | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/components/script/dom/htmliframeelement.rs b/components/script/dom/htmliframeelement.rs index ca6a504ef3e..c1ec4a7435b 100644 --- a/components/script/dom/htmliframeelement.rs +++ b/components/script/dom/htmliframeelement.rs @@ -57,14 +57,14 @@ use task_source::TaskSource; bitflags! { #[derive(JSTraceable, MallocSizeOf)] - flags SandboxAllowance: u8 { - const ALLOW_NOTHING = 0x00, - const ALLOW_SAME_ORIGIN = 0x01, - const ALLOW_TOP_NAVIGATION = 0x02, - const ALLOW_FORMS = 0x04, - const ALLOW_SCRIPTS = 0x08, - const ALLOW_POINTER_LOCK = 0x10, - const ALLOW_POPUPS = 0x20 + struct SandboxAllowance: u8 { + const ALLOW_NOTHING = 0x00; + const ALLOW_SAME_ORIGIN = 0x01; + const ALLOW_TOP_NAVIGATION = 0x02; + const ALLOW_FORMS = 0x04; + const ALLOW_SCRIPTS = 0x08; + const ALLOW_POINTER_LOCK = 0x10; + const ALLOW_POPUPS = 0x20; } } @@ -722,16 +722,16 @@ impl VirtualMethods for HTMLIFrameElement { match attr.local_name() { &local_name!("sandbox") => { self.sandbox_allowance.set(mutation.new_value(attr).map(|value| { - let mut modes = ALLOW_NOTHING; + let mut modes = SandboxAllowance::ALLOW_NOTHING; for token in value.as_tokens() { modes |= match &*token.to_ascii_lowercase() { - "allow-same-origin" => ALLOW_SAME_ORIGIN, - "allow-forms" => ALLOW_FORMS, - "allow-pointer-lock" => ALLOW_POINTER_LOCK, - "allow-popups" => ALLOW_POPUPS, - "allow-scripts" => ALLOW_SCRIPTS, - "allow-top-navigation" => ALLOW_TOP_NAVIGATION, - _ => ALLOW_NOTHING + "allow-same-origin" => SandboxAllowance::ALLOW_SAME_ORIGIN, + "allow-forms" => SandboxAllowance::ALLOW_FORMS, + "allow-pointer-lock" => SandboxAllowance::ALLOW_POINTER_LOCK, + "allow-popups" => SandboxAllowance::ALLOW_POPUPS, + "allow-scripts" => SandboxAllowance::ALLOW_SCRIPTS, + "allow-top-navigation" => SandboxAllowance::ALLOW_TOP_NAVIGATION, + _ => SandboxAllowance::ALLOW_NOTHING }; } modes |