Removing u8 from HTMLIframeElement

Remove u8 in HTMLIframeElement.rs

Remove u8 from IframeElement.rs

u8 removal

trying to pass test - uri

Update htmliframeelement.rs

u8 removal

removing u8 from Rust HTMLIFrameElement
This commit is contained in:
Patrick Trottier 2016-07-01 14:45:37 -04:00
parent b2a32ec028
commit 7be78a3e54

View file

@ -50,15 +50,17 @@ use style::context::ReflowGoal;
use url::Url; use url::Url;
use util::prefs::mozbrowser_enabled; use util::prefs::mozbrowser_enabled;
#[derive(HeapSizeOf)] bitflags! {
enum SandboxAllowance { #[derive(JSTraceable, HeapSizeOf)]
AllowNothing = 0x00, flags SandboxAllowance: u8 {
AllowSameOrigin = 0x01, const ALLOW_NOTHING = 0x00,
AllowTopNavigation = 0x02, const ALLOW_SAME_ORIGIN = 0x01,
AllowForms = 0x04, const ALLOW_TOP_NAVIGATION = 0x02,
AllowScripts = 0x08, const ALLOW_FORMS = 0x04,
AllowPointerLock = 0x10, const ALLOW_SCRIPTS = 0x08,
AllowPopups = 0x20 const ALLOW_POINTER_LOCK = 0x10,
const ALLOW_POPUPS = 0x20
}
} }
#[dom_struct] #[dom_struct]
@ -67,7 +69,7 @@ pub struct HTMLIFrameElement {
pipeline_id: Cell<Option<PipelineId>>, pipeline_id: Cell<Option<PipelineId>>,
subpage_id: Cell<Option<SubpageId>>, subpage_id: Cell<Option<SubpageId>>,
sandbox: MutNullableHeap<JS<DOMTokenList>>, sandbox: MutNullableHeap<JS<DOMTokenList>>,
sandbox_allowance: Cell<Option<u8>>, sandbox_allowance: Cell<Option<SandboxAllowance>>,
load_blocker: DOMRefCell<Option<LoadBlocker>>, load_blocker: DOMRefCell<Option<LoadBlocker>>,
visibility: Cell<bool>, visibility: Cell<bool>,
} }
@ -589,17 +591,17 @@ impl VirtualMethods for HTMLIFrameElement {
match attr.local_name() { match attr.local_name() {
&atom!("sandbox") => { &atom!("sandbox") => {
self.sandbox_allowance.set(mutation.new_value(attr).map(|value| { self.sandbox_allowance.set(mutation.new_value(attr).map(|value| {
let mut modes = SandboxAllowance::AllowNothing as u8; let mut modes = ALLOW_NOTHING;
for token in value.as_tokens() { for token in value.as_tokens() {
modes |= match &*token.to_ascii_lowercase() { modes |= match &*token.to_ascii_lowercase() {
"allow-same-origin" => SandboxAllowance::AllowSameOrigin, "allow-same-origin" => ALLOW_SAME_ORIGIN,
"allow-forms" => SandboxAllowance::AllowForms, "allow-forms" => ALLOW_FORMS,
"allow-pointer-lock" => SandboxAllowance::AllowPointerLock, "allow-pointer-lock" => ALLOW_POINTER_LOCK,
"allow-popups" => SandboxAllowance::AllowPopups, "allow-popups" => ALLOW_POPUPS,
"allow-scripts" => SandboxAllowance::AllowScripts, "allow-scripts" => ALLOW_SCRIPTS,
"allow-top-navigation" => SandboxAllowance::AllowTopNavigation, "allow-top-navigation" => ALLOW_TOP_NAVIGATION,
_ => SandboxAllowance::AllowNothing _ => ALLOW_NOTHING
} as u8; };
} }
modes modes
})); }));